Module: Mongoid_Commentable::Comment
Instance Method Summary collapse
Instance Method Details
#deleted? ⇒ Boolean
25 26 27 |
# File 'lib/comment.rb', line 25 def deleted? !!self.deleted_at end |
#level ⇒ Object
13 14 15 |
# File 'lib/comment.rb', line 13 def level path.count('.') end |
#remove ⇒ Object
17 18 19 |
# File 'lib/comment.rb', line 17 def remove self.update_attribute(:deleted_at, Time.now) end |
#restore ⇒ Object
21 22 23 |
# File 'lib/comment.rb', line 21 def restore self.update_attribute(:deleted_at, nil) end |