Module: ActiveRecord::Acts::MuckComment::InstanceMethods
- Defined in:
- lib/active_record/acts/muck_comment.rb
Overview
All the methods available to a record that has had acts_as_muck_comment
specified.
Instance Method Summary collapse
-
#after_create ⇒ Object
Send an email to everyone in the thread.
-
#can_edit?(user) ⇒ Boolean
override this method to change the way permissions are handled on comments.
-
#has_children? ⇒ Boolean
helper method to check if a comment has children.
Instance Method Details
#after_create ⇒ Object
Send an email to everyone in the thread
66 67 68 |
# File 'lib/active_record/acts/muck_comment.rb', line 66 def after_create CommentMailer.deliver_new_comment(self) if GlobalConfig.send_email_for_new_comments end |
#can_edit?(user) ⇒ Boolean
override this method to change the way permissions are handled on comments
76 77 78 79 |
# File 'lib/active_record/acts/muck_comment.rb', line 76 def can_edit?(user) return true if check_user(user) false end |
#has_children? ⇒ Boolean
helper method to check if a comment has children
71 72 73 |
# File 'lib/active_record/acts/muck_comment.rb', line 71 def has_children? self.children.size > 0 end |