Module: Mongoid::Matchers::Associations
- Included in:
- Mongoid::Matchers
- Defined in:
- lib/matchers/associations.rb
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
- #be_embedded_in(association_name) ⇒ Object
- #belong_to_related(association_name) ⇒ Object (also: #belong_to)
- #embed_many(association_name) ⇒ Object
- #embed_one(association_name) ⇒ Object
- #have_and_belong_to_many(association_name) ⇒ Object
- #have_many_related(association_name) ⇒ Object (also: #have_many)
- #have_one_related(association_name) ⇒ Object (also: #have_one)
Instance Method Details
#be_embedded_in(association_name) ⇒ Object
218 219 220 |
# File 'lib/matchers/associations.rb', line 218 def (association_name) HaveAssociationMatcher.new(association_name, EMBEDDED_IN) end |
#belong_to_related(association_name) ⇒ Object Also known as: belong_to
236 237 238 |
# File 'lib/matchers/associations.rb', line 236 def (association_name) HaveAssociationMatcher.new(association_name, BELONGS_TO) end |
#embed_many(association_name) ⇒ Object
214 215 216 |
# File 'lib/matchers/associations.rb', line 214 def (association_name) HaveAssociationMatcher.new(association_name, EMBEDS_MANY) end |
#embed_one(association_name) ⇒ Object
210 211 212 |
# File 'lib/matchers/associations.rb', line 210 def (association_name) HaveAssociationMatcher.new(association_name, EMBEDS_ONE) end |
#have_and_belong_to_many(association_name) ⇒ Object
232 233 234 |
# File 'lib/matchers/associations.rb', line 232 def have_and_belong_to_many(association_name) HaveAssociationMatcher.new(association_name, HAS_AND_BELONGS_TO_MANY) end |
#have_many_related(association_name) ⇒ Object Also known as: have_many
227 228 229 |
# File 'lib/matchers/associations.rb', line 227 def (association_name) HaveAssociationMatcher.new(association_name, HAS_MANY) end |
#have_one_related(association_name) ⇒ Object Also known as: have_one
222 223 224 |
# File 'lib/matchers/associations.rb', line 222 def (association_name) HaveAssociationMatcher.new(association_name, HAS_ONE) end |