Skip to content

Commit

Permalink
Merge pull request #20 from jgordor/master
Browse files Browse the repository at this point in the history
fix mysql_driver update query with undefined foreign key value
  • Loading branch information
evanmiller committed Jun 18, 2012
2 parents 4f3493d + 709028d commit e850674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/db_adapters/boss_db_adapter_mysql.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e850674

Please sign in to comment.