DataMapper::Aggregates::Query

Public Class Methods

included(base) click to toggle source
   # File lib/dm-aggregates/query.rb, line 4
4:       def self.included(base)
5:         base.class_eval           # FIXME: figure out a cleaner approach than AMC          alias_method :assert_valid_fields_without_operator, :assert_valid_fields          alias_method :assert_valid_fields, :assert_valid_fields_with_operator, __FILE__, __LINE__ + 1
6:       end

Public Instance Methods

assert_valid_fields_with_operator(fields, unique) click to toggle source
    # File lib/dm-aggregates/query.rb, line 12
12:       def assert_valid_fields_with_operator(fields, unique)
13:         operators, fields = fields.partition { |f| f.kind_of?(DataMapper::Query::Operator) }
14: 
15:         operators.each do |operator|
16:           target = operator.target
17: 
18:           unless target == :all || @properties.include?(target)
19:             raise ArgumentError, "+options[:fields]+ entry #{target.inspect} does not map to a property in #{model}"
20:           end
21:         end
22: 
23:         assert_valid_fields_without_operator(fields, unique)
24:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.