Class: Refinery::Blog::Category

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/refinery/blog/category.rb

Defined Under Namespace

Classes: Translation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#localeObject

Returns the value of attribute locale.



16
17
18
# File 'app/models/refinery/blog/category.rb', line 16

def locale
  @locale
end

Class Method Details

.translatedObject



22
23
24
# File 'app/models/refinery/blog/category.rb', line 22

def self.translated
  with_translations(::Globalize.locale)
end

Instance Method Details

#post_countObject



26
27
28
# File 'app/models/refinery/blog/category.rb', line 26

def post_count
  posts.live.with_globalize.count
end