我最近开始使用 code rails,我需要弄清楚这个问题。
%td
= Ahoy::Event.where(name: "viewed_brochure").where_properties(brochure_id: brochure.id).select(:session_id).uniq
这应该在属性字段中找到 session_id 的不同值的数量,但它不起作用。
此行返回这些和类似的错误
#<Ahoy::Event::ActiveRecord_Relation:0x007f52d9325130>
#<Ahoy::Event::ActiveRecord_Relation:0x007f52d9466508>
%td
= Ahoy::Event.select { |event| event.properties['session_id'] }.uniq.count
我试过这条线,但这次返回表中的行数