lib/mongoid/associations/accessor.rb in mongoid-0.7.9 vs lib/mongoid/associations/accessor.rb in mongoid-0.7.10

- old
+ new

@@ -3,12 +3,12 @@ class Accessor #:nodoc: class << self # Gets an association, based on the type provided and # passes the name and document into the newly instantiated # association. - def get(type, name, document, options = {}) - document ? type.new(name, document, options) : nil + def get(type, document, options) + document ? type.new(document, options) : nil end # Set an object association. This is used to set the parent reference # in a +BelongsTo+, a child reference in a +HasOne+, or many child # references in a +HasMany+. @@ -18,11 +18,11 @@ # type: The association type # name: The name of the association # document: The base document to handle the access for. # object: The object that was passed in to the setter method. # options: optional options. - def set(type, name, document, object, options ={}) - type.update(object, document, name, options) + def set(type, document, object, options) + type.update(object, document, options) end end end end end