blueprinter icon indicating copy to clipboard operation
blueprinter copied to clipboard

It's possible put a foreign_key for a association?

Open fede186 opened this issue 5 years ago • 1 comments

I need to specify a custom foreign_key for an association...it's possible with BluePrinter? In my serializer there is: belongs_to :sede_azienda_spedizione, class_name: 'SedeAziendaSpedizione', foreign_key: 'spedizione_def_id'

How can I write it with this gem?

Thanks in advance

fede186 avatar Nov 03 '20 11:11 fede186

You shouldn't need to do anything special as long as. the association itself is defined as you want. If that is what you're using for the association in your model, you should be able to just use

association: :sede_azienda_spedizione, blueprint: ...

in your blueprint.

adamwells avatar Mar 15 '21 20:03 adamwells