lib/iord/crud.rb in iord-1.1.1 vs lib/iord/crud.rb in iord-1.1.2
- old
+ new
@@ -17,9 +17,13 @@
end
end
def create_collection
collection = resource_class.all
+ if default(:unscoped)
+ collection = collection.unscoped
+ collection = collection.where(deleted_at: nil) if defined?(Mongoid::Paranoia) && resource_class < Mongoid::Paranoia
+ end
collection = collection.unscoped if default(:unscoped)
collection.includes(*Array(default(:includes))) if default(:includes)
collection
end