Adding non db values to the scope
Closed this issue · 1 comments
sikula commented
When using waffle_ecto the scope parameter in the storage_dir
function contains the values from cast_attachment which can only hold values from the schema, but what if I want to pass additional values that aren't part of the schema. How would I do this? Without ecto, I can just construct a map and pass it in as the scope, but with waffle_ecto that uses the schema that doesn't seem to be the case.
Thanks for the help!
achempion commented
You can define virtual fields in your schema to pass additional virtual values (or even define a separate schema if you have very complex configuration).