diff --git a/Gemfile b/Gemfile index 4be7c48c3..ea89ac79a 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,7 @@ gem 'faraday_middleware' gem 'figaro' gem 'font-awesome-rails', '4.7.0.6' gem 'jquery-rails' -gem 'jquery-ui-rails' +gem 'jquery-ui-rails', git: 'https://github.com/jquery-ui-rails/jquery-ui-rails', branch: 'master' gem 'newrelic_rpm' gem 'oj' # Amazon Linux `json` gem causes conflicts, but `multi_json` will prefer `oj` if installed diff --git a/app/models/yellow_ribbon_program.rb b/app/models/yellow_ribbon_program.rb index 631f067b6..e99f8d475 100644 --- a/app/models/yellow_ribbon_program.rb +++ b/app/models/yellow_ribbon_program.rb @@ -3,8 +3,17 @@ class YellowRibbonProgram < ApplicationRecord belongs_to :institution - delegate :country, :insturl, to: :institution delegate :institution, to: :institution, prefix: :name_of + delegate :correspondence, + :country, + :distance_learning, + :insturl, + :latitude, + :longitude, + :online_only, + :student_veteran, + :student_veteran_link, + :ungeocodable, to: :institution validates :contribution_amount, numericality: true validates :degree_level, presence: true diff --git a/app/serializers/yellow_ribbon_program_serializer.rb b/app/serializers/yellow_ribbon_program_serializer.rb index 89c1b2ef5..a0233b4a1 100644 --- a/app/serializers/yellow_ribbon_program_serializer.rb +++ b/app/serializers/yellow_ribbon_program_serializer.rb @@ -3,14 +3,24 @@ class YellowRibbonProgramSerializer < ActiveModel::Serializer attributes :city, :contribution_amount, + :correspondence, :country, :degree_level, + :distance_learning, :division_professional_school, :facility_code, :institution_id, :insturl, + :latitude, + :longitude, :number_of_students, :name_of_institution, + :online_only, :state, - :street_address + :street_address, + :student_veteran, + :student_veteran_link, + :ungeocodable, + :year_of_yr_participation, + :zip end diff --git a/spec/serializers/yellow_ribbon_program_serializer_spec.rb b/spec/serializers/yellow_ribbon_program_serializer_spec.rb index 6d854b6e2..7653418e5 100644 --- a/spec/serializers/yellow_ribbon_program_serializer_spec.rb +++ b/spec/serializers/yellow_ribbon_program_serializer_spec.rb @@ -21,10 +21,18 @@ expect(attributes['country']).to eq(yellow_ribbon_program.country) end + it 'correspondence' do + expect(attributes['correspondence']).to eq(yellow_ribbon_program.correspondence) + end + it 'degree_level' do expect(attributes['degree_level']).to eq(yellow_ribbon_program.degree_level) end + it 'distance_learning' do + expect(attributes['distance_learning']).to eq(yellow_ribbon_program.distance_learning) + end + it 'division_professional_school' do expect(attributes['division_professional_school']).to eq(yellow_ribbon_program.division_professional_school) end @@ -41,6 +49,14 @@ expect(attributes['insturl']).to eq(yellow_ribbon_program.insturl) end + it 'latitude' do + expect(attributes['latitude']).to eq(yellow_ribbon_program.latitude) + end + + it 'longitude' do + expect(attributes['longitude']).to eq(yellow_ribbon_program.longitude) + end + it 'number_of_students' do expect(attributes['number_of_students']).to eq(yellow_ribbon_program.number_of_students) end @@ -49,6 +65,10 @@ expect(attributes['name_of_institution']).to eq(yellow_ribbon_program.name_of_institution) end + it 'online_only' do + expect(attributes['online_only']).to eq(yellow_ribbon_program.online_only) + end + it 'state' do expect(attributes['state']).to eq(yellow_ribbon_program.state) end @@ -56,4 +76,24 @@ it 'street_address' do expect(attributes['street_address']).to eq(yellow_ribbon_program.street_address) end + + it 'student_veteran' do + expect(attributes['student_veteran']).to eq(yellow_ribbon_program.student_veteran) + end + + it 'student_veteran_link' do + expect(attributes['student_veteran_link']).to eq(yellow_ribbon_program.student_veteran_link) + end + + it 'ungeocodable' do + expect(attributes['ungeocodable']).to eq(yellow_ribbon_program.ungeocodable) + end + + it 'year_of_yr_participation' do + expect(attributes['year_of_yr_participation']).to eq(yellow_ribbon_program.year_of_yr_participation) + end + + it 'zip' do + expect(attributes['zip']).to eq(yellow_ribbon_program.zip) + end end diff --git a/spec/support/api/schemas/yellow_ribbon_program.json b/spec/support/api/schemas/yellow_ribbon_program.json index 24edd9219..0db709421 100644 --- a/spec/support/api/schemas/yellow_ribbon_program.json +++ b/spec/support/api/schemas/yellow_ribbon_program.json @@ -39,16 +39,26 @@ "properties": { "city": { "type": ["null", "string"] }, "contribution_amount": { "type": ["null", "string"] }, + "correspondence": { "type": ["null", "boolean"] }, "country": { "type": ["null", "string"] }, "degree_level": { "type": ["null", "string"] }, + "distance_learning": { "type": ["null", "boolean"] }, "division_professional_school": { "type": ["null", "string"] }, "facility_code": { "type": ["null", "string"] }, "institution_id": { "type": ["null", "integer"] }, "insturl": { "type": ["null", "string"] }, + "latitude": { "type": ["null", "number"] }, + "longitude": { "type": ["null", "number"] }, "name_of_institution": { "type": ["null", "string"] }, "number_of_students": { "type": ["null", "integer"] }, + "online_only": { "type": ["null", "boolean"] }, "state": { "type": ["null", "string"] }, - "street_address": { "type": ["null", "string"] } + "street_address": { "type": ["null", "string"] }, + "student_veteran": { "type": ["null", "boolean"] }, + "student_veteran_link": { "type": ["null", "string"] }, + "ungeocodable": { "type": ["null", "boolean"] }, + "year_of_yr_participation": { "type": ["null", "string"] }, + "zip": { "type": ["null", "string"] } } } },