Changeset 8627
- Timestamp:
- 01/11/08 19:54:19 (7 months ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb (modified) (1 diff)
- trunk/activerecord/test/migration_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r8594 r8627 1 1 *SVN* 2 3 * Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu] 2 4 3 5 * Fixtures: removed support for the ancient pre-YAML file format. #10736 [John Barnette] trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
r8540 r8627 454 454 args.each do |col| 455 455 column("#{col}_id", :integer, options) 456 unless polymorphic.nil? 457 column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : {}) 458 end 456 column("#{col}_type", :string, polymorphic.is_a?(Hash) ? polymorphic : options) unless polymorphic.nil? 459 457 end 460 458 end trunk/activerecord/test/migration_test.rb
r8570 r8627 926 926 end 927 927 928 def test_references_column_type_with_polymorphic_and_options_null_is_false_adds_table_flag 929 with_new_table do |t| 930 t.expects(:column).with('taggable_type', :string, {:null => false}) 931 t.expects(:column).with('taggable_id', :integer, {:null => false}) 932 t.references :taggable, :polymorphic => true, :null => false 933 end 934 end 935 928 936 def test_belongs_to_works_like_references 929 937 with_new_table do |t|