lib/set_counters.rb in set_counters-0.0.2 vs lib/set_counters.rb in set_counters-1.0.0

- old
+ new

@@ -32,10 +32,10 @@ # # WHERE id = 5 def set_counters(id, counters) updates = counters.inject([]) { |list, (counter_name, value)| list << "#{connection.quote_column_name(counter_name)} = #{value.to_i}" }.join(", ") - update_all(updates, "#{connection.quote_column_name(primary_key)} = #{quote_value(id)}") + where(id: id).update_all(updates) end end end end