# File lib/cancan/model_adapters/data_mapper_adapter.rb, line 21 def database_records scope = @model_class.all(:conditions => ["0 = 1"]) cans, cannots = @rules.partition { |r| r.base_behavior } return scope if cans.empty? # apply unions first, then differences. this mean cannot overrides can cans.each { |r| scope += @model_class.all(:conditions => r.conditions) } cannots.each { |r| scope -= @model_class.all(:conditions => r.conditions) } scope end