Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 344
- Log:
Massive changeset which brings the old, ROOL customised Instiki
version up to date, but without any ROOL customisations in this
latest checked-in version (which is 0.19.1). This is deliberate,
so that it's easy to see the changes made for the ROOL version
in a subsequent changeset. The 'app/views/shared' directory is not
part of Instiki but is kept to maintain the change history with
updated ROOL customisations, some of which involve the same files
in that same directory.
- Author:
- rool
- Date:
- Sat Mar 19 19:52:13 +0000 2011
- Size:
- 3175 Bytes
1 | require Rails.root.join('vendor', 'plugins', 'manage_fixtures', 'lib', 'manage_fixtures.rb') |
2 | |
3 | desc "use rake db:fixtures:export_using_query SQL=\"select * from foo where id='bar'\" FIXTURE_NAME=foo" |
4 | namespace :db do |
5 | namespace :fixtures do |
6 | task :export_using_query => :environment do |
7 | write_yaml_fixtures_to_file(ENV['SQL'], ENV['FIXTURE_NAME']) |
8 | end |
9 | end |
10 | end |
11 | |
12 | desc 'use rake db:fixtures:export_for_tables TABLES=foos[,bars,lands] Create YAML dump fixtures for a specific table(s) from data in an existing database. Defaults to development database. Set RAILS_ENV to override. ' |
13 | namespace :db do |
14 | namespace :fixtures do |
15 | task :export_for_tables => :environment do |
16 | sql = "SELECT * FROM %s" |
17 | tables = ENV['TABLES'] |
18 | ActiveRecord::Base.establish_connection |
19 | tables.each do |table_name| |
20 | write_yaml_fixtures_to_file(sql % table_name, table_name) |
21 | end |
22 | end |
23 | end |
24 | end |
25 | |
26 | |
27 | desc ' Create YAML dump fixtures from data in an existing database. Defaults to development database. Set RAILS_ENV to override. ' |
28 | namespace :db do |
29 | namespace :fixtures do |
30 | task :export_all => :environment do |
31 | sql = "SELECT * FROM %s" |
32 | skip_tables = ["schema_info"] |
33 | ActiveRecord::Base.establish_connection |
34 | (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
35 | i = "000" |
36 | File.open(Rails.root.join('dump', 'fixtures', table_name + '.yml'), 'w' ) do |file| |
37 | write_yaml_fixtures_to_file(sql % table_name, table_name) |
38 | end |
39 | end |
40 | end |
41 | end |
42 | end |
43 | |
44 | desc 'use rake db:fixtures:import_for_models MODELS=Foo[,Bar,Land] to import the YAML dump fixtures for a specific models from data in an existing database. Defaults to development database. Set RAILS_ENV to override. ' |
45 | namespace :db do |
46 | namespace :fixtures do |
47 | task :import_for_models => :environment do |
48 | models = ENV['MODELS'] |
49 | ActiveRecord::Base.establish_connection |
50 | models.each do |model_name| |
51 | import_model_fixture(model_name) |
52 | end |
53 | end |
54 | end |
55 | end |
56 | |
57 | |
58 | desc 'use rake db:fixtures:import_for_tables TABLES=foos[,bars,lands] to import the YAML dump fixtures for a specific tables from data in an existing database. Defaults to development database. Set RAILS_ENV to override. ' |
59 | namespace :db do |
60 | namespace :fixtures do |
61 | task :import_for_tables => :environment do |
62 | tables = ENV['TABLES'] |
63 | ActiveRecord::Base.establish_connection |
64 | tables.each do |table_name| |
65 | import_table_fixture(table_name) |
66 | end |
67 | end |
68 | end |
69 | end |
70 | |
71 | desc 'use rake db:fixtures:import_all to import all YAML dump fixtures for all of the tables from data in an existing database. Defaults to development database. Set RAILS_ENV to override. ' |
72 | namespace :db do |
73 | namespace :fixtures do |
74 | task :import_all => :environment do |
75 | ActiveRecord::Base.establish_connection |
76 | Dir.glob(Rails.root.join('dump','fixtures',"*.yml")).each do |f| |
77 | table_name = f.gsub( Regexp.escape(Rails.root.join('dump','fixtures').to_s + File::SEPARATOR), '').gsub('.yml', '') |
78 | puts "Importing #{table_name}" |
79 | import_table_fixture(table_name) |
80 | end |
81 | end |
82 | end |
83 | end |
84 |