Class: Mongoid::Report::Collections

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid/report/collections.rb

Class Method Summary collapse

Class Method Details

.get(collection_name) ⇒ Object



5
6
7
# File 'lib/mongoid/report/collections.rb', line 5

def self.get(collection_name)
  Mongoid.session(:default)[collection_name]
end

.name(model) ⇒ Object



9
10
11
12
# File 'lib/mongoid/report/collections.rb', line 9

def self.name(model)
  model && model.respond_to?(:collection) ?
    model.collection.name : model
end