AbstractAdapter
# File lib/cancan/model_adapters/data_mapper_adapter.rb, line 8 def self.find(model_class, id) model_class.get(id) end
# File lib/cancan/model_adapters/data_mapper_adapter.rb, line 4 def self.for_class?(model_class) model_class <= DataMapper::Resource end
# 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
Generated with the Darkfish Rdoc Generator 2.