Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #20 from jgordor/master

fix mysql_driver update query with undefined foreign key value
  • Loading branch information...
commit e85067476506d3487de3293ebdf0602e517e30d0 2 parents 4f3493d + 709028d
@evanmiller evanmiller authored
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]
Please sign in to comment.
Something went wrong with that request. Please try again.