Skip to content

Commit

Permalink
find first now returns nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianolorenti committed Oct 14, 2018
1 parent 7be7344 commit 9826380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/database_adapters/PostgreSQLDatabaseAdapter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function to_store_sql(m::T; conflict_strategy = :error)::String where {T<:Abstra

sql = if ! is_persisted(m) || (is_persisted(m) && conflict_strategy == :update)
pos = findfirst(x -> x == primary_key_name(m), uf)
pos > 0 && splice!(uf, pos)
pos != nothing && splice!(uf, pos)

fields = SQLColumn(uf)
vals = join( map(x -> string(to_sqlinput(m, Symbol(x), getfield(m, Symbol(x)))), uf), ", ")
Expand Down

0 comments on commit 9826380

Please sign in to comment.