lib/mongoid/relations/builder.rb in mongoid-2.2.0 vs lib/mongoid/relations/builder.rb in mongoid-2.2.1
- old
+ new
@@ -33,11 +33,10 @@
#
# @return [ true, false ] Whether a database query should happen.
#
# @since 2.0.0.rc.1
def query?
- return true unless object.respond_to?(:to_a)
- obj = object.to_a.first
+ obj = Array(object).first
!obj.is_a?(Mongoid::Document) && !obj.nil?
end
end
end
end