From 979adea8787ef88f62b8dcc1962ae8ce3481978b Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 3 Apr 2013 09:52:38 -0300 Subject: [PATCH] Move alias method near to the aliased one in collection proxy --- .../lib/active_record/associations/collection_proxy.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index c2add32aa6a55..83b7aecd54b01 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -228,6 +228,7 @@ def last(*args) def build(attributes = {}, &block) @association.build(attributes, &block) end + alias_method :new, :build # Returns a new object of the collection type that has been instantiated with # attributes, linked to this object and that has already been saved (if it @@ -832,8 +833,6 @@ def include?(record) @association.include?(record) end - alias_method :new, :build - def proxy_association @association end