ankane / ahoy

Simple, powerful, first-party analytics for Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polymorphic User

cheeeeeeeeeen opened this issue · comments

Hello. Is this currently possible? I am trying the gem out and it's pretty fantastic. However, what if say I want to have 2 different user models integrated into Visit? For example, customers and merchants. I thought a polymorphic association would be neat, but I am stumbled how to properly assign user_type upon the creation of a visit.

Hey @cheeeeeeeeeen, you should be able to override the track_visit method to populate user_type, similar to this: #434 (comment)