Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix mysql_driver update query with undefined foreign key value #20

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/db_adapters/boss_db_adapter_mysql.erl
View
6 src/db_adapters/boss_db_adapter_mysql.erl
@@ -255,11 +255,11 @@ build_update_query(Record) ->
({id, _}, Acc) -> Acc;
({A, V}, Acc) ->
AString = atom_to_list(A),
- Value = case lists:suffix("_id", AString) of
- true ->
+ Value = case {lists:suffix("_id", AString), V =:= undefined} of
+ {true, false} ->
{_, _, ForeignId} = infer_type_from_id(V),
ForeignId;
- false ->
+ _ ->
V
end,
[AString ++ " = " ++ pack_value(Value)|Acc]
Something went wrong with that request. Please try again.