Skip to content

Commit

Permalink
update hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jun 10, 2018
1 parent 613d0c6 commit 255ce24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/my_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def update
:id, :email, :current_password, :password, :password_confirmation
]
user_attrs += [
{:user_has_role_attributes => [:id, :role_id]}
{user_has_role_attributes: [:id, :role_id]}
] if current_user.has_role?('Administrator')

user_params = ActionController::Parameters.new(params[:profile][:user_attributes]).permit(*user_attrs)
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def profile_params
attrs += [
:library_id, :expired_at, :birth_date,
:user_group_id, :required_role_id, :note, :user_number, {
:user_attributes => [
user_attributes: [
:id, :username, :email, :current_password, :locked,
{:user_has_role_attributes => [:id, :role_id]}
{user_has_role_attributes: [:id, :role_id]}
]
}
] if current_user.has_role?('Librarian')
Expand All @@ -201,9 +201,9 @@ def profile_update_params
attrs += [
:library_id, :expired_at, :birth_date,
:user_group_id, :required_role_id, :note, :user_number, {
:user_attributes => [
user_attributes: [
:id, :email, :current_password, :auto_generated_password, :locked,
{:user_has_role_attributes => [:id, :role_id]}
{user_has_role_attributes: [:id, :role_id]}
]
}
] if current_user.has_role?('Librarian')
Expand Down

0 comments on commit 255ce24

Please sign in to comment.