Skip to content

Commit

Permalink
Drop false values from prop hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny Mukai authored and Michael Freedman & Michael Gamba committed Jun 25, 2012
1 parent 3b64efb commit 0969ecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def save(table, data)
@database.execute(sql)

data.each do |key, value|
sql = if value.nil?
sql = if value.nil? || value == false
%Q{DELETE FROM #{table} WHERE key = "#{key}"}
else
%Q{INSERT OR REPLACE INTO #{table} (key,value) VALUES ("#{key}", "#{value}")}
Expand Down

0 comments on commit 0969ecb

Please sign in to comment.