Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8631

Show
Ignore:
Timestamp:
01/12/08 01:33:02 (6 months ago)
Author:
nzkoz
Message:

Merge [8627] fix to stable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2-0-stable/activerecord/CHANGELOG

    r8585 r8631  
    11*SVN* 
     2 
     3* Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations.  Closes #10753 [railsjitsu] 
    24 
    35* 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  
    454454        args.each do |col| 
    455455          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? 
    459457        end 
    460458      end 
  • branches/2-0-stable/activerecord/test/migration_test.rb

    r8453 r8631  
    926926      end 
    927927       
     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 
    928936      def test_belongs_to_works_like_references 
    929937        with_new_table do |t|