diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-01 15:09:56 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-01 15:09:56 -0300 |
commit | 736bf14d7c15776f17f6e096dba5024a36d15580 (patch) | |
tree | 0db6556859595f586c2c171599713112b0268d1d /activerecord/test | |
parent | 0c527026308627652c42ed8a6f26a21d3bbc7a5b (diff) | |
download | rails-736bf14d7c15776f17f6e096dba5024a36d15580.tar.gz rails-736bf14d7c15776f17f6e096dba5024a36d15580.tar.bz2 rails-736bf14d7c15776f17f6e096dba5024a36d15580.zip |
Revert "Deprecating composed_of in ActiveRecord"
This reverts commit 44b313bc4e3762da64dde7894548f81c595147de.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/aggregations_test.rb | 8 | ||||
-rw-r--r-- | activerecord/test/models/customer.rb | 10 | ||||
-rw-r--r-- | activerecord/test/models/developer.rb | 4 |
3 files changed, 7 insertions, 15 deletions
diff --git a/activerecord/test/cases/aggregations_test.rb b/activerecord/test/cases/aggregations_test.rb index 7eb7ffdd2d..3e0e6dce2c 100644 --- a/activerecord/test/cases/aggregations_test.rb +++ b/activerecord/test/cases/aggregations_test.rb @@ -126,15 +126,11 @@ class OverridingAggregationsTest < ActiveRecord::TestCase class DifferentName; end class Person < ActiveRecord::Base - ActiveSupport::Deprecation.silence do - composed_of :composed_of, :mapping => %w(person_first_name first_name) - end + composed_of :composed_of, :mapping => %w(person_first_name first_name) end class DifferentPerson < Person - ActiveSupport::Deprecation.silence do - composed_of :composed_of, :class_name => 'DifferentName', :mapping => %w(different_person_first_name first_name) - end + composed_of :composed_of, :class_name => 'DifferentName', :mapping => %w(different_person_first_name first_name) end def test_composed_of_aggregation_redefinition_reflections_should_differ_and_not_inherited diff --git a/activerecord/test/models/customer.rb b/activerecord/test/models/customer.rb index 7f1687be5e..777f6b5ba0 100644 --- a/activerecord/test/models/customer.rb +++ b/activerecord/test/models/customer.rb @@ -1,10 +1,8 @@ class Customer < ActiveRecord::Base - ActiveSupport::Deprecation.silence do - composed_of :address, :mapping => [ %w(address_street street), %w(address_city city), %w(address_country country) ], :allow_nil => true - composed_of :balance, :class_name => "Money", :mapping => %w(balance amount), :converter => Proc.new { |balance| balance.to_money } - composed_of :gps_location, :allow_nil => true - composed_of :fullname, :mapping => %w(name to_s), :constructor => Proc.new { |name| Fullname.parse(name) }, :converter => :parse - end + composed_of :address, :mapping => [ %w(address_street street), %w(address_city city), %w(address_country country) ], :allow_nil => true + composed_of :balance, :class_name => "Money", :mapping => %w(balance amount), :converter => Proc.new { |balance| balance.to_money } + composed_of :gps_location, :allow_nil => true + composed_of :fullname, :mapping => %w(name to_s), :constructor => Proc.new { |name| Fullname.parse(name) }, :converter => :parse end class Address diff --git a/activerecord/test/models/developer.rb b/activerecord/test/models/developer.rb index 7ff769f0bf..4dc9fff9fd 100644 --- a/activerecord/test/models/developer.rb +++ b/activerecord/test/models/developer.rb @@ -73,9 +73,7 @@ end DeveloperSalary = Struct.new(:amount) class DeveloperWithAggregate < ActiveRecord::Base self.table_name = 'developers' - ActiveSupport::Deprecation.silence do - composed_of :salary, :class_name => 'DeveloperSalary', :mapping => [%w(salary amount)] - end + composed_of :salary, :class_name => 'DeveloperSalary', :mapping => [%w(salary amount)] end class DeveloperWithBeforeDestroyRaise < ActiveRecord::Base |