Class: Refinery::Blog::Category
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Refinery::Blog::Category
- Extended by:
- FriendlyId
- Defined in:
- app/models/refinery/blog/category.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.by_title(title) ⇒ Object
18 19 20 |
# File 'app/models/refinery/blog/category.rb', line 18 def self.by_title(title) joins(:translations).find_by(title: title) end |
.translated ⇒ Object
22 23 24 |
# File 'app/models/refinery/blog/category.rb', line 22 def self.translated with_translations(::Globalize.locale) end |
Instance Method Details
#post_count ⇒ Object
26 27 28 |
# File 'app/models/refinery/blog/category.rb', line 26 def post_count posts.live.with_globalize.count end |