aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/collection_proxy.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-04-03 09:52:38 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-04-03 09:52:38 -0300
commit979adea8787ef88f62b8dcc1962ae8ce3481978b (patch)
tree1d59a1c5e9fe78b2ea6a17d80ddc07199b191354 /activerecord/lib/active_record/associations/collection_proxy.rb
parent37683266d86db2b7c39cb32a1e39e3698f6a93a8 (diff)
downloadrails-979adea8787ef88f62b8dcc1962ae8ce3481978b.tar.gz
rails-979adea8787ef88f62b8dcc1962ae8ce3481978b.tar.bz2
rails-979adea8787ef88f62b8dcc1962ae8ce3481978b.zip
Move alias method near to the aliased one in collection proxy
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_proxy.rb')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index c2add32aa6..83b7aecd54 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -228,6 +228,7 @@ module ActiveRecord
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 @@ module ActiveRecord
@association.include?(record)
end
- alias_method :new, :build
-
def proxy_association
@association
end