Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 173
- Log:
Updated to latest release of Beast according to the "getting started with
Beast" guide at:http://beast.caboo.se/forums/1/topics/381
This check-in includes frozen Edge Rails and has the beginnings of
configuration for the ROOL site included.
- Author:
- rool
- Date:
- Fri Mar 02 15:59:12 +0000 2007
- Size:
- 931 Bytes
1 | class Post < ActiveRecord::Base |
2 | belongs_to :forum, :counter_cache => true |
3 | belongs_to :user, :counter_cache => true |
4 | belongs_to :topic, :counter_cache => true |
5 | |
6 | format_attribute :body |
7 | before_create { |r| r.forum_id = r.topic.forum_id } |
8 | after_create { |r| Topic.update_all(['replied_at = ?, replied_by = ?, last_post_id = ?', r.created_at, r.user_id, r.id], ['id = ?', r.topic_id]) } |
9 | after_destroy { |r| t = Topic.find(r.topic_id) ; Topic.update_all(['replied_at = ?, replied_by = ?, last_post_id = ?', t.posts.last.created_at, t.posts.last.user_id, t.posts.last.id], ['id = ?', t.id]) if t.posts.last } |
10 | |
11 | validates_presence_of :user_id, :body |
12 | attr_accessible :body |
13 | |
14 | def editable_by?(user) |
15 | user && (user.id == user_id || user.admin? || user.moderator_of?(topic.forum_id)) |
16 | end |
17 | |
18 | def to_xml(options = {}) |
19 | options[:except] ||= [] |
20 | options[:except] << :topic_title << :forum_name |
21 | super |
22 | end |
23 | end |