From 69f68b6551aa6500c3557555cb5f291a50122c80 Mon Sep 17 00:00:00 2001 From: Yong Bakos Date: Mon, 7 Sep 2020 23:49:47 -0700 Subject: [PATCH] Activity: Add days attribute. References #52. --- db/migrate/20200908064831_add_days_to_activity.rb | 5 +++++ db/schema.rb | 3 ++- spec/models/activity_spec.rb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200908064831_add_days_to_activity.rb diff --git a/db/migrate/20200908064831_add_days_to_activity.rb b/db/migrate/20200908064831_add_days_to_activity.rb new file mode 100644 index 0000000..4953c2f --- /dev/null +++ b/db/migrate/20200908064831_add_days_to_activity.rb @@ -0,0 +1,5 @@ +class AddDaysToActivity < ActiveRecord::Migration[5.2] + def change + add_column :activities, :days, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 90bcdf2..d7f2791 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_09_04_071039) do +ActiveRecord::Schema.define(version: 2020_09_08_064831) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -53,6 +53,7 @@ t.time "start_time" t.date "end_date" t.time "end_time" + t.string "days" t.index ["author_id"], name: "index_activities_on_author_id" end diff --git a/spec/models/activity_spec.rb b/spec/models/activity_spec.rb index 80ca763..420a5c5 100644 --- a/spec/models/activity_spec.rb +++ b/spec/models/activity_spec.rb @@ -9,6 +9,7 @@ specify { expect(activity).to respond_to(:end_date) } specify { expect(activity).to respond_to(:start_time) } specify { expect(activity).to respond_to(:end_time) } + specify { expect(activity).to respond_to(:days) } specify { expect(activity).to respond_to(:description) } specify { expect(activity).to respond_to(:location) } specify { expect(activity).to respond_to(:contact_name) }