diff options
-rw-r--r-- | activerecord/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/aggregations.rb | 3 | ||||
-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 |
5 files changed, 7 insertions, 24 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 63baa7a389..f4a573bb72 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -28,12 +28,6 @@ *Jon Leighton* -* `composed_of` has been deprecated. You'll have to write your own accessor - and mutator methods if you'd like to use value objects to represent some - portion of your models. - - *Steve Klabnik* - * `update_attribute` has been deprecated. Use `update_column` if you want to bypass mass-assignment protection, validations, callbacks, and touching of updated_at. Otherwise please use `update_attributes`. diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index e7ed2644ca..c39284539c 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -161,8 +161,6 @@ module ActiveRecord # # Customer.where(:balance => Money.new(20, "USD")).all # - # Note: +composed_of+ has been deprecated, and will be removed (with no - # replacement) in Rails 4. module ClassMethods # Adds reader and writer methods for manipulating a value object: # <tt>composed_of :address</tt> adds <tt>address</tt> and <tt>address=(new_address)</tt> methods. @@ -205,7 +203,6 @@ module ActiveRecord # :converter => Proc.new { |ip| ip.is_a?(Integer) ? IPAddr.new(ip, Socket::AF_INET) : IPAddr.new(ip.to_s) } # def composed_of(part_id, options = {}) - ActiveSupport::Deprecation.warn("composed_of is deprecated, and will be removed in Rails 4. There is no replacement.") options.assert_valid_keys(:class_name, :mapping, :allow_nil, :constructor, :converter) name = part_id.id2name 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 |