lib/ripple/associations/many_embedded_proxy.rb in ripple-0.7.1 vs lib/ripple/associations/many_embedded_proxy.rb in ripple-0.8.0.beta
- old
+ new
@@ -19,15 +19,17 @@
include Many
include Embedded
def <<(docs)
load_target
+ @reflection.verify_type!(Array(docs), @owner)
assign_references(docs)
@target += Array(docs)
self
end
def replace(docs)
+ @reflection.verify_type!(docs, @owner)
@_docs = docs.map { |doc| attrs = doc.respond_to?(:attributes_for_persistence) ? doc.attributes_for_persistence : doc }
assign_references(docs)
reset
@_docs
end