app/commands/decidim/admin/officialize_user.rb in decidim-admin-0.9.3 vs app/commands/decidim/admin/officialize_user.rb in decidim-admin-0.10.0
- old
+ new
@@ -35,13 +35,26 @@
private
attr_reader :form
def officialize_user
- form.user.update!(
- officialized_at: Time.current,
- officialized_as: form.officialized_as
- )
+ timestamp = Time.current
+ Decidim.traceability.perform_action!(
+ "officialize",
+ form.user,
+ form.current_user,
+ extra: {
+ officialized_user_badge: form.officialized_as,
+ officialized_user_badge_previous: form.user.officialized_as,
+ officialized_user_at: timestamp,
+ officialized_user_at_previous: form.user.officialized_at
+ }
+ ) do
+ form.user.update!(
+ officialized_at: timestamp,
+ officialized_as: form.officialized_as
+ )
+ end
end
end
end
end