Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 445
- Log:
Eager loading of the User object associated with the most recent
post in a Forum ought to speed things up, but in this context it
was causing a significant performance issue seen in particular
when trying to fetch the top-level list of forums. Just getting
rid of the eager-load instruction fixes the performance issue.
- Author:
- rool
- Date:
- Mon Sep 02 08:09:37 +0100 2013
- Size:
- 534 Bytes
1 | class Forum < ActiveRecord::Base |
2 | acts_as_list |
3 | |
4 | validates_presence_of :name |
5 | |
6 | has_many :moderatorships, :dependent => :destroy |
7 | has_many :moderators, :through => :moderatorships, :source => :user, :order => 'users.login' |
8 | |
9 | has_many :topics, :order => 'sticky desc, replied_at desc', :dependent => :destroy do |
10 | def first |
11 | @first_topic ||= find(:first) |
12 | end |
13 | end |
14 | |
15 | has_many :posts, :order => 'posts.created_at desc' do |
16 | def last |
17 | @last_post ||= find(:first) |
18 | end |
19 | end |
20 | |
21 | format_attribute :description |
22 | end |