Class: Tag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Tag
- Defined in:
- app/models/tag.rb
Instance Method Summary collapse
Instance Method Details
#before_save ⇒ Object
7 8 9 |
# File 'app/models/tag.rb', line 7 def before_save self.tag = CGI.escapeElement(self.tag, 'script') end |
#related_tags ⇒ Object
11 12 13 14 15 |
# File 'app/models/tag.rb', line 11 def = [] self.posts.each { |p| p..each { |tt| << tt } } .uniq.select { |t| t.tag != self.tag } end |