Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 390
- Log:
Initial import of Canvass, a donations-based poll application.
- Author:
- rool
- Date:
- Mon Mar 21 14:58:04 +0000 2011
- Size:
- 1372 Bytes
1 | ######################################################################## |
2 | # File:: 20090416130108_load_currencies_from_yaml_data.rb |
3 | # (C):: Hipposoft 2009, 2010, 2011 |
4 | # |
5 | # Purpose:: Load an initial data set into the 'currencies' table. |
6 | # ---------------------------------------------------------------------- |
7 | # 16-Apr-2009 (ADH): Created. |
8 | # 18-Feb-2011 (ADH): Imported from Artisan. |
9 | ######################################################################## |
10 | |
11 | require 'yaml' |
12 | require 'active_record/fixtures' |
13 | |
14 | class LoadCurrenciesFromYamlData < ActiveRecord::Migration |
15 | |
16 | # Note that this is an aggressive and rather stupid migration. If someone |
17 | # had run this migration, added various currencies and later decided to roll |
18 | # back the migration, they might be surprised to find that it deletes *all* |
19 | # currencies, not just the ones it added. That's pretty nasty. |
20 | # |
21 | #TODO Improve LoadCurrenciesFromYamlData 'down' code, if it seems worthwhile. |
22 | |
23 | def self.up |
24 | directory = File.join( RAILS_ROOT, 'test', 'fixtures' ) |
25 | Fixtures.create_fixtures( directory, 'currencies' ) |
26 | |
27 | # Canvass doesn't use Locations like Artisan. |
28 | # |
29 | # # Associate some of the basic currencies with locations, if locations can |
30 | # # be found. |
31 | # |
32 | # Currency.establish_predefined_associations |
33 | end |
34 | |
35 | def self.down |
36 | Currency.delete_all |
37 | end |
38 | end |