Commit 8d5fa833 authored by James Lopez's avatar James Lopez

fix update service

parent 3e267417
...@@ -17,7 +17,7 @@ module Users ...@@ -17,7 +17,7 @@ module Users
user_exists = @user.persisted? user_exists = @user.persisted?
if @user.save(validate: validate) if @user.save(validate: validate)
audit_changes(:email, as: 'email address', column: :notification_email) audit_changes(:email, as: 'email address')
audit_changes(:encrypted_password, as: 'password', skip_changes: true) audit_changes(:encrypted_password, as: 'password', skip_changes: true)
notify_new_user(@user, nil) unless user_exists notify_new_user(@user, nil) unless user_exists
......
...@@ -57,15 +57,15 @@ module EE ...@@ -57,15 +57,15 @@ module EE
def for_changes def for_changes
@details = @details =
{ {
change: @details[:as] || @details[:column], change: @details[:as] || @details[:column],
from: @details[:from], from: @details[:from],
to: @details[:to], to: @details[:to],
author_name: @author.name, author_name: @author.name,
target_id: @entity.id, target_id: @entity.id,
target_type: @entity.class, target_type: @entity.class,
target_details: @entity.name target_details: @entity.name
} }
self self
end end
...@@ -110,7 +110,7 @@ module EE ...@@ -110,7 +110,7 @@ module EE
def method_missing(method_sym, *arguments, &block) def method_missing(method_sym, *arguments, &block)
super(method_sym, *arguments, &block) unless respond_to?(method_sym) super(method_sym, *arguments, &block) unless respond_to?(method_sym)
for_custom_model(method_sym.to_s.slice('for_'), *arguments) for_custom_model(method_sym.to_s.split('for_').last, *arguments)
end end
def respond_to?(method, include_private = false) def respond_to?(method, include_private = false)
...@@ -125,24 +125,24 @@ module EE ...@@ -125,24 +125,24 @@ module EE
model_class = model.camelize model_class = model.camelize
@details = @details =
case action case action
when :destroy when :destroy
{ {
remove: model, remove: model,
author_name: author_name, author_name: author_name,
target_id: key_title, target_id: key_title,
target_type: model_class, target_type: model_class,
target_details: key_title target_details: key_title
} }
when :create when :create
{ {
add: model, add: model,
author_name: author_name, author_name: author_name,
target_id: key_title, target_id: key_title,
target_type: model_class, target_type: model_class,
target_details: key_title target_details: key_title
} }
end end
self self
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment