Module: Mongoid::Userstamps::Created

Extended by:
ActiveSupport::Concern
Included in:
Mongoid::Userstamps
Defined in:
lib/mongoid/userstamps/created.rb

Instance Method Summary collapse

Instance Method Details

#set_created_byObject



20
21
22
23
24
# File 'lib/mongoid/userstamps/created.rb', line 20

def set_created_by
  user = self.class.current_user
  return if !user || public_send(userstamps_config.created_name)
  public_send("#{userstamps_config.created_name}=", user)
end