Closed TaylorMerritt closed 3 years ago
Sorry for the late reply. I missed the notification :<
This issue is related to https://github.com/khiav223577/deep_pluck/pull/36
The problem is that we have no way to guarantee we can find the inverse association of training_program.training_provider
It tried to use training_programs
, but in this example, it should be borrower_training_programs
This is the pseudo code of what happening when you call TrainingProgram.deep_pluck(:name, training_provider: :name)
Maybe we can use the hints from the inverse_of
option. I'm going to explore the rails source code and figure out how it works.
Thank you @khiav223577 ! Appears to be working in my project now.
It appears when deep pluck attempts to figure out the association in reverse, it doesn't observer the correct association name. It seems to be using the class name rather than the association name (
training_programs
rather thanborrower_training_programs
).