Module: MopedMapping::NodeExt

Defined in:
lib/moped_mapping/node_ext.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
9
10
11
# File 'lib/moped_mapping/node_ext.rb', line 6

def self.included(klass)
  klass.module_eval do
    alias_method :query_without_mapping, :query
    alias_method :query, :query_with_mapping
  end
end

Instance Method Details

#query_with_mapping(database, collection, selector, options = {}, &block) ⇒ Object



13
14
15
16
# File 'lib/moped_mapping/node_ext.rb', line 13

def query_with_mapping(database, collection, selector, options = {}, &block)
  collection = MopedMapping.mapped_name(database, collection)
  return query_without_mapping(database, collection, selector, options, &block)
end