Browse Source

refactored

pull/787/head
JG 3 years ago
parent
commit
4b04faa95b
  1. 2
      app/controllers/users_controller.rb
  2. 5
      db/migrate/20220728092850_change_default_value_for_user_role.rb
  3. 4
      db/schema.rb

2
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

5
db/migrate/20220728092850_change_default_value_for_user_role.rb

@ -1,5 +0,0 @@
class ChangeDefaultValueForUserRole < ActiveRecord::Migration[7.0]
def change
change_column_default :users, :role, 1
end
end

4
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

Loading…
Cancel
Save