root/trunk/demo/app/models/content.rb
| Revision 223, 270 bytes (checked in by jk, 1 year ago) |
|---|
| Line | |
|---|---|
| 1 | class Content < ContentBase #ActiveRecord::Base |
| 2 | |
| 3 | def self.per_page; 10; end |
| 4 | |
| 5 | has_many :comments |
| 6 | |
| 7 | # returns the number of comments attached to this content. |
| 8 | # the value returned by this method will be indexed, too. |
| 9 | def comment_count |
| 10 | comments.size |
| 11 | end |
| 12 | end |
Note: See TracBrowser for help on using the browser.
