diff options
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/db_definitions/schema.rb | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/parrot.rb | 8 | ||||
-rw-r--r-- | activerecord/test/fixtures/parrots.yml | 6 |
3 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/db_definitions/schema.rb b/activerecord/test/fixtures/db_definitions/schema.rb index f6bd0efa5d..a943b84f42 100644 --- a/activerecord/test/fixtures/db_definitions/schema.rb +++ b/activerecord/test/fixtures/db_definitions/schema.rb @@ -307,6 +307,8 @@ ActiveRecord::Schema.define do create_table :parrots, :force => true do |t| t.column :name, :string + t.column :parrot_sti_class, :string + t.column :killer_id, :integer t.column :created_at, :datetime t.column :created_on, :datetime t.column :updated_at, :datetime diff --git a/activerecord/test/fixtures/parrot.rb b/activerecord/test/fixtures/parrot.rb index 10850669e7..65191c1aa5 100644 --- a/activerecord/test/fixtures/parrot.rb +++ b/activerecord/test/fixtures/parrot.rb @@ -1,5 +1,13 @@ class Parrot < ActiveRecord::Base + set_inheritance_column :parrot_sti_class has_and_belongs_to_many :pirates has_and_belongs_to_many :treasures has_many :loots, :as => :looter end + +class LiveParrot < Parrot +end + +class DeadParrot < Parrot + belongs_to :killer, :class_name => 'Pirate' +end diff --git a/activerecord/test/fixtures/parrots.yml b/activerecord/test/fixtures/parrots.yml index dd2c9548e7..8b73b8cdf6 100644 --- a/activerecord/test/fixtures/parrots.yml +++ b/activerecord/test/fixtures/parrots.yml @@ -1,21 +1,27 @@ george: name: "Curious George" treasures: diamond, sapphire + parrot_sti_class: LiveParrot louis: name: "King Louis" treasures: [diamond, sapphire] + parrot_sti_class: LiveParrot frederick: name: $LABEL + parrot_sti_class: LiveParrot polly: id: 4 name: $LABEL + killer: blackbeard treasures: sapphire, ruby + parrot_sti_class: DeadParrot DEFAULTS: &DEFAULTS treasures: sapphire, ruby + parrot_sti_class: LiveParrot davey: <<: *DEFAULTS |