Class: Article
- Inherits:
-
Noodall::Node
- Object
- Noodall::Node
- Article
- Extended by:
- Noodall::Articles::Categories
- Defined in:
- app/models/article.rb
Instance Method Summary collapse
Methods included from Noodall::Articles::Categories
Instance Method Details
#category_list ⇒ Object
17 18 19 |
# File 'app/models/article.rb', line 17 def category_list categories.join(',') end |
#category_list=(string) ⇒ Object
13 14 15 |
# File 'app/models/article.rb', line 13 def category_list=(string) self.categories = string.to_s.split(',').map{ |t| t.strip.titlecase }.reject(&:blank?).compact.uniq end |
#related_articles ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/models/article.rb', line 21 def @related_articles ||= begin siblings .published .order('published_date DESC') .where(:tags => /(#{.join('|')})/i) .limit(3) end end |