Browse Source

Fix admin password update

pull/156/head^2
baarkerlounger 3 years ago
parent
commit
b9493f2cac
  1. 2
      app/admin/admin_users.rb
  2. 2
      app/admin/users.rb
  3. 2
      app/views/users/show.html.erb

2
app/admin/admin_users.rb

@ -3,7 +3,7 @@ ActiveAdmin.register AdminUser do
controller do controller do
def update_resource(object, attributes) def update_resource(object, attributes)
update_method = attributes.first[:password].present? ? :update_attributes : :update_without_password update_method = attributes.first[:password].present? ? :update : :update_without_password
object.send(update_method, *attributes) object.send(update_method, *attributes)
end end
end end

2
app/admin/users.rb

@ -3,7 +3,7 @@ ActiveAdmin.register User do
controller do controller do
def update_resource(object, attributes) def update_resource(object, attributes)
update_method = attributes.first[:password].present? ? :update_attributes : :update_without_password update_method = attributes.first[:password].present? ? :update : :update_without_password
object.send(update_method, *attributes) object.send(update_method, *attributes)
end end
end end

2
app/views/users/show.html.erb

@ -31,7 +31,7 @@
<%= summary_list.row do |row| <%= summary_list.row do |row|
row.key { 'Organisation' } row.key { 'Organisation' }
row.value { current_user.organisation } row.value { current_user.organisation.name }
row.action() row.action()
end %> end %>

Loading…
Cancel
Save