From 08fb323c19a0578fe008e04eb3af0c988096c86d Mon Sep 17 00:00:00 2001 From: github username Date: Sat, 5 Oct 2019 15:54:39 -0400 Subject: [PATCH] Added housing_provided column to locations table, defaulting to false 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 #397. It will allow housing data to be stored in the back end for each location. --- app/serializers/location_serializer.rb | 2 +- .../20191005191332_add_provides_housing_to_location.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20191005191332_add_provides_housing_to_location.rb diff --git a/app/serializers/location_serializer.rb b/app/serializers/location_serializer.rb index e3b67828..c024b017 100644 --- a/app/serializers/location_serializer.rb +++ b/app/serializers/location_serializer.rb @@ -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 diff --git a/db/migrate/20191005191332_add_provides_housing_to_location.rb b/db/migrate/20191005191332_add_provides_housing_to_location.rb new file mode 100644 index 00000000..6019d3bf --- /dev/null +++ b/db/migrate/20191005191332_add_provides_housing_to_location.rb @@ -0,0 +1,5 @@ +class AddProvidesHousingToLocation < ActiveRecord::Migration[5.0] + def change + add_column :locations, :provides_housing, :boolean, :default => false + end +end