Skip to content

Commit

Permalink
Move alias method near to the aliased one in collection proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Apr 3, 2013
1 parent 3768326 commit 979adea
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -228,6 +228,7 @@ def last(*args)
def build(attributes = {}, &block) def build(attributes = {}, &block)
@association.build(attributes, &block) @association.build(attributes, &block)
end end
alias_method :new, :build


# Returns a new object of the collection type that has been instantiated with # 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 # attributes, linked to this object and that has already been saved (if it
Expand Down Expand Up @@ -832,8 +833,6 @@ def include?(record)
@association.include?(record) @association.include?(record)
end end


alias_method :new, :build

def proxy_association def proxy_association
@association @association
end end
Expand Down

0 comments on commit 979adea

Please sign in to comment.