From 5892cab7c670943d32e66877a9f0752a99312f72 Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 29 Jun 2022 16:14:48 +0100 Subject: [PATCH] switched to int for confirm --- app/models/scheme.rb | 4 ++-- db/migrate/20220623132228_add_has_other_client_group_field.rb | 2 +- db/schema.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 44f994428..f93c08778 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -79,8 +79,8 @@ class Scheme < ApplicationRecord }.freeze HAS_OTHER_CLIENT_GROUP = { - "Yes": "yes", - "No": "no", + No: 0, + Yes: 1, }.freeze enum intended_stay: INTENDED_STAY, _suffix: true diff --git a/db/migrate/20220623132228_add_has_other_client_group_field.rb b/db/migrate/20220623132228_add_has_other_client_group_field.rb index 138cd26f1..af04a6af8 100644 --- a/db/migrate/20220623132228_add_has_other_client_group_field.rb +++ b/db/migrate/20220623132228_add_has_other_client_group_field.rb @@ -1,7 +1,7 @@ class AddHasOtherClientGroupField < ActiveRecord::Migration[7.0] def change change_table :schemes, bulk: true do |t| - t.column :has_other_client_group, :string + t.column :has_other_client_group, :integer end end end diff --git a/db/schema.rb b/db/schema.rb index df867b241..280bd3b59 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -310,7 +310,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_29_105452) do t.integer "support_type" t.string "intended_stay" t.datetime "end_date" - t.string "has_other_client_group" + t.integer "has_other_client_group" t.bigint "stock_owning_organisation_id" t.index ["organisation_id"], name: "index_schemes_on_organisation_id" t.index ["stock_owning_organisation_id"], name: "index_schemes_on_stock_owning_organisation_id"