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:
- 1137 Bytes
1 | require 'bare_migration' |
2 | class FixupForthcomingPublications < ActiveRecord::Migration |
3 | class Trigger < ActiveRecord::Base |
4 | belongs_to :pending_item, :polymorphic => true |
5 | end |
6 | |
7 | class Content < ActiveRecord::Base |
8 | end |
9 | |
10 | class Article < Content |
11 | end |
12 | |
13 | def self.up |
14 | return if $schema_generator |
15 | Article.transaction do |
16 | Trigger.transaction do |
17 | Article.find(:all, :conditions => ['published = ? AND published_at > ?', |
18 | true, Time.now]).each do |art| |
19 | Trigger.create!(:pending_item => art, |
20 | :due_at => art.published_at, |
21 | :trigger_method => 'publish!') |
22 | art.update_attribute(:published, false) |
23 | end |
24 | end |
25 | end |
26 | end |
27 | |
28 | def self.down |
29 | return if $schema_generator |
30 | Article.transaction do |
31 | Trigger.transaction do |
32 | Trigger.find(:all, |
33 | :conditions => "pending_item_type = 'Article' AND trigger_method = 'publish!'").each do |t| |
34 | t.pending_item.update_attribute(:published, :true) |
35 | t.destroy |
36 | end |
37 | end |
38 | end |
39 | end |
40 | end |