lib/pluck_map/relationships.rb in pluck_map-1.0.0.rc2 vs lib/pluck_map/relationships.rb in pluck_map-1.0.0
- old
+ new
@@ -51,10 +51,14 @@
owner = AbstractOwner.new(reflection)
reflection.association_class.new(owner, reflection)
end
def scope_for(association)
- AssociationScope.create.scope(association)
+ default_scope_for(association).merge(AssociationScope.create.scope(association))
+ end
+
+ def default_scope_for(association)
+ association.klass.all
end
# ActiveRecord constructs an Association from a Reflection and an
# Owner. It expects Owner to be an instance of an ActiveRecord object
# and uses `[]` to access specific values for fields on the record.