Changeset 8631
- Timestamp:
- 01/12/08 01:33:02 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/activerecord/CHANGELOG
r8585 r8631 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 * update_all ignores scoped :order and :limit, so post.comments.update_all doesn't try to include the comment order in the update statement. #10686 [Brendan Ribera] branches/2-0-stable/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
r8481 r8631 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 branches/2-0-stable/activerecord/test/migration_test.rb
r8453 r8631 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|