I started code rails recently and I need to figure out this problem.
%td
= Ahoy::Event.where(name: "viewed_brochure").where_properties(brochure_id: brochure.id).select(:session_id).uniq
This should find number of distinct values of session_id in properties field but it doesn't work.
This line returns these and similar errors
#<Ahoy::Event::ActiveRecord_Relation:0x007f52d9325130>
#<Ahoy::Event::ActiveRecord_Relation:0x007f52d9466508>
%td
= Ahoy::Event.select { |event| event.properties['session_id'] }.uniq.count
I tried this line but this time returns number of rows in table