mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
15 lines
316 B
Ruby
15 lines
316 B
Ruby
module Shared::UserStamper
|
|
extend ActiveSupport::Concern
|
|
|
|
def stamp(obj)
|
|
return false if obj.nil? || !obj.has_attribute?(:created_by_id && :updated_by_id)
|
|
|
|
if obj.new_record?
|
|
obj.created_by_id = current_epp_user.id
|
|
else
|
|
obj.updated_by_id = current_epp_user.id
|
|
end
|
|
|
|
true
|
|
end
|
|
end
|