Skip to content
Browse files

Move alias method near to the aliased one in collection proxy

  • Loading branch information...
1 parent 3768326 commit 979adea8787ef88f62b8dcc1962ae8ce3481978b @carlosantoniodasilva carlosantoniodasilva committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/associations/collection_proxy.rb
View
3 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

0 comments on commit 979adea

Please sign in to comment.
Something went wrong with that request. Please try again.