Class: WPDB::Comment
- Inherits:
-
Object
- Object
- WPDB::Comment
- Defined in:
- lib/ruby-wpdb/comment.rb
Instance Method Summary collapse
Instance Method Details
#before_validation ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/ruby-wpdb/comment.rb', line 20 def before_validation self.comment_date ||= Time.now self.comment_date_gmt ||= Time.now.utc self.comment_parent ||= 0 self.comment_approved ||= 1 super end |
#validate ⇒ Object
15 16 17 18 |
# File 'lib/ruby-wpdb/comment.rb', line 15 def validate super validates_presence [:comment_author, :comment_author_email, :comment_date, :comment_date_gmt, :comment_parent, :comment_approved] end |