mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
15 lines
323 B
Ruby
15 lines
323 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
|
|
|
|
return true
|
|
end
|
|
end
|