diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-26 22:45:43 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-26 22:45:43 +0000 |
commit | 8b3f83105ce719642a8f079f72c4f03c97cfc321 (patch) | |
tree | 86fd9a3b6e69a25cbddb904ce8d3bb5edb4eca34 /activerecord/test/fixtures | |
parent | 1370d1578727bdbfee06ccdf2109e8ca5649a652 (diff) | |
download | rails-8b3f83105ce719642a8f079f72c4f03c97cfc321.tar.gz rails-8b3f83105ce719642a8f079f72c4f03c97cfc321.tar.bz2 rails-8b3f83105ce719642a8f079f72c4f03c97cfc321.zip |
Foxy fixtures: allow mixed usage to make migration easier and more attractive. Closes #10004.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8218 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/db_definitions/schema.rb | 10 | ||||
-rw-r--r-- | activerecord/test/fixtures/joke.rb | 3 | ||||
-rw-r--r-- | activerecord/test/fixtures/matey.rb | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/parrots.yml | 5 | ||||
-rw-r--r-- | activerecord/test/fixtures/ship.rb | 3 | ||||
-rw-r--r-- | activerecord/test/fixtures/ships.yml | 5 |
6 files changed, 23 insertions, 5 deletions
diff --git a/activerecord/test/fixtures/db_definitions/schema.rb b/activerecord/test/fixtures/db_definitions/schema.rb index 9b6b6987d2..f6bd0efa5d 100644 --- a/activerecord/test/fixtures/db_definitions/schema.rb +++ b/activerecord/test/fixtures/db_definitions/schema.rb @@ -335,10 +335,18 @@ ActiveRecord::Schema.define do t.column :parrot_id, :integer t.column :treasure_id, :integer end - + create_table :mateys, :id => false, :force => true do |t| t.column :pirate_id, :integer t.column :target_id, :integer t.column :weight, :integer end + + create_table :ships, :force => true do |t| + t.string :name + t.datetime :created_at + t.datetime :created_on + t.datetime :updated_at + t.datetime :updated_on + end end diff --git a/activerecord/test/fixtures/joke.rb b/activerecord/test/fixtures/joke.rb index 8006a43bd7..3978abc2ba 100644 --- a/activerecord/test/fixtures/joke.rb +++ b/activerecord/test/fixtures/joke.rb @@ -1,6 +1,3 @@ class Joke < ActiveRecord::Base set_table_name 'funny_jokes' end -class Joke < ActiveRecord::Base - set_table_name 'funny_jokes' -end
\ No newline at end of file diff --git a/activerecord/test/fixtures/matey.rb b/activerecord/test/fixtures/matey.rb index 86442e0470..47b0baa974 100644 --- a/activerecord/test/fixtures/matey.rb +++ b/activerecord/test/fixtures/matey.rb @@ -1,4 +1,4 @@ class Matey < ActiveRecord::Base belongs_to :pirate - belongs_to :target, :class_name => 'Pirate', :foreign_key => 'target_id' + belongs_to :target, :class_name => 'Pirate' end diff --git a/activerecord/test/fixtures/parrots.yml b/activerecord/test/fixtures/parrots.yml index 74bc6b4e78..dd2c9548e7 100644 --- a/activerecord/test/fixtures/parrots.yml +++ b/activerecord/test/fixtures/parrots.yml @@ -9,6 +9,11 @@ louis: frederick: name: $LABEL +polly: + id: 4 + name: $LABEL + treasures: sapphire, ruby + DEFAULTS: &DEFAULTS treasures: sapphire, ruby diff --git a/activerecord/test/fixtures/ship.rb b/activerecord/test/fixtures/ship.rb new file mode 100644 index 0000000000..05b09fc1b9 --- /dev/null +++ b/activerecord/test/fixtures/ship.rb @@ -0,0 +1,3 @@ +class Ship < ActiveRecord::Base + self.record_timestamps = false +end
\ No newline at end of file diff --git a/activerecord/test/fixtures/ships.yml b/activerecord/test/fixtures/ships.yml new file mode 100644 index 0000000000..137055aad1 --- /dev/null +++ b/activerecord/test/fixtures/ships.yml @@ -0,0 +1,5 @@ +black_pearl: + name: "Black Pearl" +interceptor: + id: 2 + name: "Interceptor" |