I am using ahoy
gem for analytics. In the ahoy_events
table, I have properties
column of json data type. I want to find specific data based on that column.
Suppose I have
{"tag":"a","class":"bigyapan-6","page":"/client/dashboard","text":"","href":"http://www.google.com"}
this as data and I want to find_by class.
In the rails c
I ran Ahoy::Event.find_by(properties[:class]: "bigyapan-6")
and it gave me an err
Ahoy::Event.find_by(properties["class"]: "bigyapan-6")
SyntaxError: unexpected ')', expecting end-of-input