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
17 18 19 20 21 22 |
# File 'app/models/comment.rb', line 17 def approve(user) self.approved = 1 self.user = user self.approved_at = Time.now self.save end |
#approved? ⇒ Boolean
13 14 15 |
# File 'app/models/comment.rb', line 13 def approved? self.approved == 1 end |