Module: DataMapper::Aggregates::Query

### Home Classes Methods

### In Files

- lib/dm-aggregates/query.rb

### Methods

- ::included
- #assert_valid_fields_with_operator

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Adapters
- DataMapper::Aggregates
- DataMapper::Aggregates::Collection
- DataMapper::Aggregates::DataObjectsAdapter
- DataMapper::Aggregates::Functions
- DataMapper::Aggregates::Model
- DataMapper::Aggregates::Operators
- DataMapper::Aggregates::Query
- DataMapper::Aggregates::Repository
- Symbol

No matching classes.

# DataMapper::Aggregates::Query

### Public Class Methods

included(base) click to toggle source

    # File lib/dm-aggregates/query.rb, line 4
    def self.included(base)
      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
    end

### Public Instance Methods

assert_valid_fields_with_operator(fields, unique) click to toggle source

    # File lib/dm-aggregates/query.rb, line 12
    def assert_valid_fields_with_operator(fields, unique)
      operators, fields = fields.partition { |f| f.kind_of?(DataMapper::Query::Operator) }

      operators.each do |operator|
        target = operator.target

        unless target == :all || @properties.include?(target)
          raise ArgumentError, "+options[:fields]+ entry #{target.inspect} does not map to a property in #{model}"
        end
      end

      assert_valid_fields_without_operator(fields, unique)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.