class Joey::Comment
Public Instance Methods
valid?()
click to toggle source
# File lib/joey/comment.rb, line 14 def valid? self.validate puts self.errors.inspect unless self.errors.empty? self.errors.empty? end
validate()
click to toggle source
# File lib/joey/comment.rb, line 7 def validate created_time.to_time rescue errors << { :message => 'created_time is not compatible' } # updated_time.to_time rescue errors << { :message => 'updated_time is not compatible' } errors << { :message => 'id should not be nil' } if id.nil? errors << { :message => 'from is not a Joey::User or Joey::Page' } unless from.is_a?(Joey::User) || from.is_a?(Joey::Page) end