Class: Cornerstone::Category

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/cornerstone/category.rb

Constant Summary collapse

TYPES =

CONSTANTS == #

["Discussion", "Article"]

Instance Method Summary collapse

Instance Method Details

#latest_discussionObject

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