Module: Mongoid::Matchers::Associations
Defined Under Namespace
Classes: HaveAssociationMatcher
Constant Summary
collapse
- HAS_MANY =
Mongoid::Relations::Referenced::Many
- HAS_AND_BELONGS_TO_MANY =
Mongoid::Relations::Referenced::ManyToMany
- HAS_ONE =
Mongoid::Relations::Referenced::One
- BELONGS_TO =
Mongoid::Relations::Referenced::In
- EMBEDS_MANY =
Mongoid::Relations::Embedded::Many
- EMBEDS_ONE =
Mongoid::Relations::Embedded::One
- EMBEDDED_IN =
Mongoid::Relations::Embedded::In
Instance Method Summary
collapse
Instance Method Details
#be_embedded_in(association_name) ⇒ Object
307
308
309
|
# File 'lib/matchers/associations.rb', line 307
def be_embedded_in(association_name)
HaveAssociationMatcher.new(association_name, EMBEDDED_IN)
end
|
325
326
327
|
# File 'lib/matchers/associations.rb', line 325
def belong_to_related(association_name)
HaveAssociationMatcher.new(association_name, BELONGS_TO)
end
|
#embed_many(association_name) ⇒ Object
303
304
305
|
# File 'lib/matchers/associations.rb', line 303
def embed_many(association_name)
HaveAssociationMatcher.new(association_name, EMBEDS_MANY)
end
|
#embed_one(association_name) ⇒ Object
299
300
301
|
# File 'lib/matchers/associations.rb', line 299
def embed_one(association_name)
HaveAssociationMatcher.new(association_name, EMBEDS_ONE)
end
|
#have_and_belong_to_many(association_name) ⇒ Object
321
322
323
|
# File 'lib/matchers/associations.rb', line 321
def have_and_belong_to_many(association_name)
HaveAssociationMatcher.new(association_name, HAS_AND_BELONGS_TO_MANY)
end
|
316
317
318
|
# File 'lib/matchers/associations.rb', line 316
def have_many_related(association_name)
HaveAssociationMatcher.new(association_name, HAS_MANY)
end
|
311
312
313
|
# File 'lib/matchers/associations.rb', line 311
def have_one_related(association_name)
HaveAssociationMatcher.new(association_name, HAS_ONE)
end
|