Class: Uchi::Field::HasAndBelongsToMany::Show
- Inherits:
-
Base::Show
- Object
- ViewComponent::Base
- Base::Show
- Uchi::Field::HasAndBelongsToMany::Show
show all
- Defined in:
- app/components/uchi/field/has_and_belongs_to_many.rb
Instance Attribute Summary
Attributes inherited from Base::Show
#field, #record, #repository
Instance Method Summary
collapse
Methods inherited from Base::Show
#initialize
Instance Method Details
#associated_records ⇒ Object
27
28
29
30
31
|
# File 'app/components/uchi/field/has_and_belongs_to_many.rb', line 27
def associated_records
records = field.value(record)
associated_repository.find_all(scope: records)
end
|
#associated_repository ⇒ Object
33
34
35
|
# File 'app/components/uchi/field/has_and_belongs_to_many.rb', line 33
def associated_repository
field.associated_repository(record: record)
end
|