diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-06-24 11:17:05 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-06-24 11:17:05 -0300 |
commit | fdb7f84eb10c5e59490764a1a259aa00a1fcfe5f (patch) | |
tree | 90750a64cb361762d3d27920aa7dfa3d989da320 /activerecord/lib/active_record | |
parent | 7710a8cb6b0f3b8f94c130aa5d6062d45e34219c (diff) | |
download | rails-fdb7f84eb10c5e59490764a1a259aa00a1fcfe5f.tar.gz rails-fdb7f84eb10c5e59490764a1a259aa00a1fcfe5f.tar.bz2 rails-fdb7f84eb10c5e59490764a1a259aa00a1fcfe5f.zip |
Remove deprecated block usage in composed_of.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/aggregations.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 51ffc7542c..c45400d3d9 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -190,7 +190,7 @@ module ActiveRecord # :constructor => Proc.new { |ip| IPAddr.new(ip, Socket::AF_INET) }, # :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 = {}, &block) + def composed_of(part_id, options = {}) options.assert_valid_keys(:class_name, :mapping, :allow_nil, :constructor, :converter) name = part_id.id2name @@ -199,9 +199,7 @@ module ActiveRecord mapping = [ mapping ] unless mapping.first.is_a?(Array) allow_nil = options[:allow_nil] || false constructor = options[:constructor] || :new - converter = options[:converter] || block - - ActiveSupport::Deprecation.warn('The conversion block has been deprecated, use the :converter option instead.', caller) if block_given? + converter = options[:converter] reader_method(name, class_name, mapping, allow_nil, constructor) writer_method(name, class_name, mapping, allow_nil, converter) |