Class: Elabs::Comment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Elabs::Comment
- Defined in:
- app/models/elabs/comment.rb
Instance Attribute Summary
Attributes inherited from ApplicationRecord
Instance Method Summary collapse
Instance Method Details
#notify_author ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/models/elabs/comment.rb', line 18 def notification = { content: content, event: :comment, user_id: content.user_id } notification[:source_user] = user if user_id Elabs::Notification.create! notification end |
#notify_author? ⇒ Boolean
14 15 16 |
# File 'app/models/elabs/comment.rb', line 14 def user_id ? content.user_id != user_id : true end |