Class: Uchi::Field::HasAndBelongsToMany::Show

Inherits:
Base::Show show all
Defined in:
app/components/uchi/field/has_and_belongs_to_many.rb

Instance Attribute Summary

Attributes inherited from Base::Component

#field, #record, #repository

Instance Method Summary collapse

Methods inherited from Base::Component

#initialize, #value

Methods included from RoutesHelper

#uchi_path_to

Constructor Details

This class inherits a constructor from Uchi::Field::Base::Component

Instance Method Details

#associated_records ⇒ Object



29
30
31
32
33
# File 'app/components/uchi/field/has_and_belongs_to_many.rb', line 29

def associated_records
  records = value

  associated_repository.find_all(scope: records)
end

#associated_repository ⇒ Object



35
36
37
# File 'app/components/uchi/field/has_and_belongs_to_many.rb', line 35

def associated_repository
  field.associated_repository(record: record)
end