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

Constructor Details

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

Instance Method Details

#associated_recordsObject



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

def associated_records
  records = value

  associated_repository.find_all(scope: records)
end

#associated_repositoryObject



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