Class: Chatty::Message
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Chatty::Message
- Defined in:
- app/models/chatty/message.rb
Instance Method Summary collapse
Instance Method Details
#json ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/models/chatty/message.rb', line 8 def json return { :id => id, :message => , :user_id => user.id, :user_name => (user[:name].presence || user[:email].presence || user.id), :created_at => created_at.strftime("%Y-%m-%d %H:%M:%S") } end |