Class: Comment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Comment
- Defined in:
- app/models/comment.rb
Instance Method Summary collapse
Instance Method Details
#approve(user) ⇒ Object
19 20 21 22 23 24 |
# File 'app/models/comment.rb', line 19 def approve(user) self.approved = 1 self.user = user self.approved_at = Time.now self.save end |
#approved? ⇒ Boolean
15 16 17 |
# File 'app/models/comment.rb', line 15 def approved? self.approved == 1 end |