Class: Moped::PromiscuousDatabase
- Inherits:
-
Database
- Object
- Database
- Moped::PromiscuousDatabase
- Defined in:
- lib/promiscuous/publisher/operation/mongoid.rb
Instance Method Summary collapse
-
#command(command) ⇒ Object
Moped::Database.
-
#promiscuous_read_operation(options = {}) ⇒ Object
TODO it might be safer to use the alias attribute method because promiscuous may come late in the loading.
Instance Method Details
#command(command) ⇒ Object
Moped::Database
281 282 283 284 285 286 287 288 |
# File 'lib/promiscuous/publisher/operation/mongoid.rb', line 281 def command(command) if command[:mapreduce] query = Moped::Query.new(self[command[:mapreduce]], command[:query]) promiscuous_read_operation(:query => query, :operation_ext => :mapreduce).execute { super } else super end end |
#promiscuous_read_operation(options = {}) ⇒ Object
TODO it might be safer to use the alias attribute method because promiscuous may come late in the loading.
275 276 277 |
# File 'lib/promiscuous/publisher/operation/mongoid.rb', line 275 def promiscuous_read_operation(={}) Moped::PromiscuousQueryWrapper::PromiscuousReadOperation.new() end |