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

Changeset 4981

Show
Ignore:
Timestamp:
09/04/06 07:08:16 (2 years ago)
Author:
bitsweat
Message:

Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true. Closes #6024.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r4980 r4981  
    11*SVN* 
     2 
     3* Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true.  #6024 [Josh Susser] 
    24 
    35* Document validates_presences_of behavior with booleans: you probably want validates_inclusion_of :attr, :in => [true, false].  #2253 [Bob Silva] 
  • trunk/activerecord/lib/active_record/associations.rb

    r4898 r4981  
    992992          if reflection.options[:exclusively_dependent] 
    993993            reflection.options[:dependent] = :delete_all 
    994             #warn "The :exclusively_dependent option is deprecated.  Please use :dependent => :delete_all instead."
     994            ::ActiveSupport::Deprecation.warn("The :exclusively_dependent option is deprecated and will be removed from Rails 2.0.  Please use :dependent => :delete_all instead.  See http://www.rubyonrails.org/deprecation for details.", caller
    995995          end 
    996996 
  • trunk/activerecord/test/associations_test.rb

    r4893 r4981  
    179179    assert_equal [account_id], Account.destroyed_account_ids[firm.id] 
    180180  end 
    181    
     181 
     182  def test_deprecated_exclusive_dependence 
     183    assert_deprecated(/:exclusively_dependent.*:dependent => :delete_all/) do 
     184      Firm.has_many :deprecated_exclusively_dependent_clients, :class_name => 'Client', :exclusively_dependent => true 
     185    end 
     186  end 
     187 
    182188  def test_exclusive_dependence 
    183189    num_accounts = Account.count 
  • trunk/activerecord/test/reflection_test.rb

    r4893 r4981  
    144144   
    145145  def test_reflection_of_all_associations 
    146     assert_equal 15, Firm.reflect_on_all_associations.size 
    147     assert_equal 13, Firm.reflect_on_all_associations(:has_many).size 
     146    assert_equal 16, Firm.reflect_on_all_associations.size 
     147    assert_equal 14, Firm.reflect_on_all_associations(:has_many).size 
    148148    assert_equal 2, Firm.reflect_on_all_associations(:has_one).size 
    149149    assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size