lib/reactor/models/subscriber.rb in reactor-0.2.4 vs lib/reactor/models/subscriber.rb in reactor-0.2.5
- old
+ new
@@ -30,10 +30,10 @@
# until then, here's a helper to make it easy to create with random data in postgres
# total crap I know but whatever
define_singleton_method :exists! do
chain = where(event: name)
data.each do |key, value|
- chain = chain.where("data @> '#{key}=#{value}'")
+ chain = chain.where("subscribers.data @> ?", "#{key}=>#{value}")
end
chain.first_or_create!(data)
end
end
end
\ No newline at end of file