I have this read action in my resource
read :by_entity do argument :entity_full_name, :string, allow_nil?: false filter expr( fragment("(? %> ?)", first_grantee_full_name, ^arg(:entity_full_name)) and not is_nil(recording_date || instrument_date) and (recording_date || instrument_date) >= ago(2, :year) and not deleted? ) prepare build(sort: [:recording_date], load: [:sell_record, :fix_and_flip?]) end
B has an attribute called
:entity_name, I want to join resource
A to a resource
B using that
read action, AFAIK, to do that I would need to do this:
has_many :owner_records, Record do no_attributes? true read_action :by_entity end
The problem is that I don’t know how to pass resource
:entity_name attribute as the argument for resource
A read action
:entity_full_name in the
has_many code block.
Is that possible? How can I achieve that?