Open btkostner opened 5 years ago
Unfortunately with the DSL there are some reserved keywords that cause weird behavior when they are used. In this case it's an unhelpful compilation error. I've been adding more useful compiler errors as they come up and will add one for this case. The only workaround that I know of is to use the relationship/2
callback directly.
If it's just the one relationship, you should be able to replace has_one
with the following (untested but something close to this):
def relationships(movement, conn) do
%{
location: %HasOne{
serializer: LocationView,
links: [
related: location_link(movement, conn)
],
data: movement.location
}
}
end
def location_link(movement, conn),
do: inventory_location_path(conn, :show, movement.location_id)
Having a view like so (minified):
results in an error during compile:
This was not a problem in
0.13.0
, but is in0.15.0
.OTP: 22 Elixir: 1.8.2