Class: WPDB::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-wpdb/comments.rb

Instance Method Summary collapse

Instance Method Details

#before_validationObject



20
21
22
23
24
25
26
# File 'lib/ruby-wpdb/comments.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

#validateObject



15
16
17
18
# File 'lib/ruby-wpdb/comments.rb', line 15

def validate
  super
  validates_presence [:comment_author, :comment_author_email, :comment_date, :comment_date_gmt, :comment_parent, :comment_approved]
end