diff --git a/app/models/section.rb b/app/models/section.rb index 6db0398..aa3078e 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -6,7 +6,6 @@ # description :text # modifiable :boolean # number :integer -# published :boolean # title :string # created_at :datetime # updated_at :datetime @@ -49,9 +48,6 @@ uniqueness: { scope: :phase_id, message: UNIQUENESS_MESSAGE } - validates :published, inclusion: { in: BOOLEAN_VALUES, - message: INCLUSION_MESSAGE } - validates :modifiable, inclusion: { in: BOOLEAN_VALUES, message: INCLUSION_MESSAGE } diff --git a/db/migrate/20180803105147_remove_published_from_sections.rb b/db/migrate/20180803105147_remove_published_from_sections.rb new file mode 100644 index 0000000..03fa4b8 --- /dev/null +++ b/db/migrate/20180803105147_remove_published_from_sections.rb @@ -0,0 +1,8 @@ +class RemovePublishedFromSections < ActiveRecord::Migration + def up + remove_column :sections, :published, :boolean + end + def down + add_column :sections, :published, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index 2d5eebe..6bf71f9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180713164120) do +ActiveRecord::Schema.define(version: 20180803105147) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -314,7 +314,6 @@ t.integer "number" t.datetime "created_at" t.datetime "updated_at" - t.boolean "published" t.integer "phase_id" t.boolean "modifiable" end diff --git a/spec/factories/sections.rb b/spec/factories/sections.rb index 85de359..9fbadc3 100644 --- a/spec/factories/sections.rb +++ b/spec/factories/sections.rb @@ -18,7 +18,6 @@ title { Faker::Lorem.sentence } description { Faker::Lorem.paragraph } sequence(:number) - published false phase modifiable false end