Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 988 Bytes
1 | class Bare33Content < ActiveRecord::Base |
2 | include BareMigration |
3 | |
4 | def count_children_of_type(type) |
5 | self.class.find(:all, |
6 | :conditions => ["article_id = ? and type = ?", |
7 | self.id, type ]).size |
8 | end |
9 | |
10 | def correct_counts |
11 | self.comments_count = self.count_children_of_type('Comment') |
12 | self.trackbacks_count = self.count_children_of_type('Trackback') |
13 | end |
14 | end |
15 | |
16 | |
17 | class AddCountCaching < ActiveRecord::Migration |
18 | def self.up |
19 | STDERR.puts "Adding comments_count, trackbacks_count" |
20 | modify_tables_and_update([:add_column, Bare33Content, :comments_count, :integer], |
21 | [:add_column, Bare33Content, :trackbacks_count, :integer]) do |a| |
22 | if not $schema_generator |
23 | a.correct_counts |
24 | end |
25 | end |
26 | end |
27 | |
28 | def self.down |
29 | STDERR.puts "Removing counts columns" |
30 | remove_column :contents, :comments_count |
31 | remove_column :contents, :trackbacks_count |
32 | end |
33 | end |
34 |