diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f797bad14..2013bc360 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -74,7 +74,7 @@ class UsersController < ApplicationController redirect_to created_user_redirect_path else unless @resource.errors[:organisation].empty? - @resource.errors.add(:organisation_id, message: @user.errors[:organisation]) + @resource.errors.add(:organisation_id, message: @resource.errors[:organisation]) @resource.errors.delete(:organisation) end render :new, status: :unprocessable_entity diff --git a/db/migrate/20220728092850_change_default_value_for_user_role.rb b/db/migrate/20220728092850_change_default_value_for_user_role.rb deleted file mode 100644 index e6844003b..000000000 --- a/db/migrate/20220728092850_change_default_value_for_user_role.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ChangeDefaultValueForUserRole < ActiveRecord::Migration[7.0] - def change - change_column_default :users, :role, 1 - end -end diff --git a/db/schema.rb b/db/schema.rb index 0f12622c0..39bc35e94 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[7.0].define(version: 2022_07_28_092850) do +ActiveRecord::Schema[7.0].define(version: 2022_07_22_083835) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -341,7 +341,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_28_092850) do t.datetime "last_sign_in_at", precision: nil t.string "current_sign_in_ip" t.string "last_sign_in_ip" - t.integer "role", default: 1 + t.integer "role" t.string "old_user_id" t.string "phone" t.integer "failed_attempts", default: 0