Module: NoBrainer::Matchers::Associations
- Included in:
- NoBrainer::Matchers
- Defined in:
- lib/matchers/associations.rb
Defined Under Namespace
Classes: HaveAssociationMatcher
Constant Summary collapse
- HAS_MANY =
NoBrainer::Document::Association::HasMany
- HAS_MANY_THROUGH =
NoBrainer::Document::Association::HasManyThrough
- HAS_ONE =
NoBrainer::Document::Association::HasOne
- HAS_ONE_THROUGH =
NoBrainer::Document::Association::HasOneThrough
- BELONGS_TO =
NoBrainer::Document::Association::BelongsTo
Instance Method Summary collapse
- #belong_to_related(association_name) ⇒ Object (also: #belong_to)
- #have_many_related(association_name) ⇒ Object (also: #have_many)
- #have_one_related(association_name) ⇒ Object (also: #have_one)
Instance Method Details
#belong_to_related(association_name) ⇒ Object Also known as: belong_to
281 282 283 |
# File 'lib/matchers/associations.rb', line 281 def (association_name) HaveAssociationMatcher.new(association_name, BELONGS_TO) end |
#have_many_related(association_name) ⇒ Object Also known as: have_many
276 277 278 |
# File 'lib/matchers/associations.rb', line 276 def (association_name) HaveAssociationMatcher.new(association_name, HAS_MANY) end |
#have_one_related(association_name) ⇒ Object Also known as: have_one
271 272 273 |
# File 'lib/matchers/associations.rb', line 271 def (association_name) HaveAssociationMatcher.new(association_name, HAS_ONE) end |