Module: MongoModel
Instance Method Summary
collapse
#embed_many, #embed_one, #field, #fields, #many, #modify_field, #one, #remove_field
Instance Method Details
#collection(*name) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/yodel/models/core/model/mongo_model.rb', line 18
def collection(*name)
if name.size == 1
@collection = Yodel.db.collection(name.first, pk: PrimaryKeyFactory)
else
@collection
end
end
|
#load(values) ⇒ Object
14
15
16
|
# File 'lib/yodel/models/core/model/mongo_model.rb', line 14
def load(values)
new(values, false)
end
|
#scoped(scope = {}) ⇒ Object
10
11
12
|
# File 'lib/yodel/models/core/model/mongo_model.rb', line 10
def scoped(scope={})
Query.new(self, nil, collection, scope)
end
|