Class: Ping

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/ping.rb

Instance Method Summary collapse

Instance Method Details

#before_saveObject



10
11
12
13
14
15
# File 'app/models/ping.rb', line 10

def before_save
  self.title      = CGI.escapeElement(self.title, 'script')
  self.excerpt    = CGI.escapeElement(self.excerpt, 'script')
  self.url        = CGI.escapeElement(self.url, 'script')
  self.blog_name  = CGI.escapeElement(self.blog_name, 'script')
end

#validateObject



6
7
8
# File 'app/models/ping.rb', line 6

def validate
  errors.add('post_id', 'Must have a post id') if self.post_id == 0
end