mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
15 lines
326 B
Ruby
15 lines
326 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_user.id
|
|
# else
|
|
# obj.updated_by_id = current_user.id
|
|
# end
|
|
|
|
# true
|
|
# end
|
|
end
|