stavro / arc_ecto

An integration with Arc and Ecto.
255 stars 149 forks source link

Specify Field Name In Scope #114

Open jtfairbank opened 5 years ago

jtfairbank commented 5 years ago

Currently Arc Ecto passes the model into the definition functions as the scope. However if the model has two fields, say an Avatar and a Background, there is no way to distinguish between those photos in the definition functions.

There are a number of work-arounds including having two definition files, creating child models for each image, etc. However those seem overly complex for such a simple use case.

I propose that Arc Ecto passes in a {model, field} tuple for the scope. This could only occur if a specific option is set in the definition file, so that there are no breaking changes to the existing api.