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:
- 1649 Bytes
1 | # BareMigration doesn't handle inheritance yet. Therefore, we need |
2 | # to mimic it manually using conditions on find(). Since this script |
3 | # doesn't need to set type or id, there's no need to move either of |
4 | # the protected fields out of the way like we do in #20-23. |
5 | |
6 | # BareMigration ALSO doesn't handle associations... yet. |
7 | # For now, that means your keywords won't be automatically converted |
8 | # to tags. That might not be a bad thing... |
9 | |
10 | |
11 | class Bare24Article < ActiveRecord::Base |
12 | include BareMigration |
13 | include TypoGuid |
14 | |
15 | set_table_name :contents |
16 | has_and_belongs_to_many :tags, |
17 | :class_name => 'Bare24Tag', :foreign_key => 'article_id', |
18 | :join_table => 'articles_tags', :association_foreign_key => 'tag_id' |
19 | |
20 | def keywords_to_tags |
21 | Bare24Article.transaction do |
22 | tags.clear |
23 | keywords.to_s.split.uniq.each do |tagword| |
24 | tags << Bare24Tag.get(tagword) |
25 | end |
26 | end |
27 | end |
28 | end |
29 | |
30 | class Bare24Tag < ActiveRecord::Base |
31 | include BareMigration |
32 | has_and_belongs_to_many :articles, |
33 | :class_name => 'Bare24Article', :foreign_key => 'tag_id', |
34 | :join_table => 'articles_tags', :association_foreign_key => 'articles_id' |
35 | end |
36 | |
37 | class CleanupContents < ActiveRecord::Migration |
38 | def self.up |
39 | STDERR.puts "Updating all articles" |
40 | # This is needed when migrating from 2.5.x, because we skip GUID |
41 | # generation and tagging during earlier migrations. |
42 | Bare24Article.transaction do |
43 | Bare24Article.find(:all, :conditions => "type = 'Article'").each do |a| |
44 | a.create_guid |
45 | # a.keywords_to_tags (not needed?) |
46 | a.save! |
47 | end |
48 | end |
49 | end |
50 | |
51 | def self.down |
52 | # nothing |
53 | end |
54 | end |