Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 873 Bytes
1 | class RemoveCountCaching < ActiveRecord::Migration |
2 | class Content < ActiveRecord::Base |
3 | include BareMigration |
4 | |
5 | def count_children_of_type(type) |
6 | self.class.find(:all, |
7 | :conditions => ["article_id = ? and type = ?", |
8 | self.id, type]).size |
9 | end |
10 | |
11 | def correct_counts |
12 | self.comments_count = self.count_children_of_type('Comment') |
13 | self.trackbacks_count = self.count_children_of_type('Trackback') |
14 | end |
15 | end |
16 | |
17 | def self.up |
18 | remove_column :contents, :comments_count |
19 | remove_column :contents, :trackbacks_count |
20 | end |
21 | |
22 | def self.down |
23 | modify_tables_and_update( |
24 | [:add_column, Content, :comments_count, :integer], |
25 | [:add_column, Content, :trackbacks_count, :integer]) do |a| |
26 | if not $schema_generator |
27 | a.correct_counts |
28 | end |
29 | end |
30 | end |
31 | end |