Class: Cornerstone::Category
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Cornerstone::Category
- Defined in:
- app/models/cornerstone/category.rb
Constant Summary collapse
- TYPES =
CONSTANTS == #
["Discussion", "Article"]
Instance Method Summary collapse
-
#latest_discussion ⇒ Object
Provides the latest discussion created for this category.
-
#latest_discussions(num = nil) ⇒ Object
Provides the last ‘num’ discussions created for this category.
Instance Method Details
#latest_discussion ⇒ Object
Provides the latest discussion created for this category
34 35 36 |
# File 'app/models/cornerstone/category.rb', line 34 def latest_discussion latest_discussions(1).first end |
#latest_discussions(num = nil) ⇒ Object
Provides the last ‘num’ discussions created for this category
39 40 41 |
# File 'app/models/cornerstone/category.rb', line 39 def latest_discussions(num=nil) Discussion.latest_for_category(self, num) end |