Skip to content

Commit

Permalink
Added housing_provided column to locations table, defaulting to false
Browse files Browse the repository at this point in the history
Created a new migration to add a housing_provided column to the locations table, with a default value of false. Also added housing_provided to the locations serializer so that it is rendered in the JSON returned from the API.

This commit is meant to solve issue OperationCode#397. It will allow housing data to be stored in the back end for each location.
  • Loading branch information
github username committed Oct 5, 2019
1 parent ae23877 commit 08fb323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/serializers/location_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class LocationSerializer < ActiveModel::Serializer
attributes :va_accepted, :address1, :address2, :city, :state, :zip
attributes :va_accepted, :address1, :address2, :city, :state, :zip, :provides_housing
end
5 changes: 5 additions & 0 deletions db/migrate/20191005191332_add_provides_housing_to_location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddProvidesHousingToLocation < ActiveRecord::Migration[5.0]
def change
add_column :locations, :provides_housing, :boolean, :default => false
end
end

0 comments on commit 08fb323

Please sign in to comment.