New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 3 compatibility? #28
Comments
Looks like |
Thank you! Page refresh seems to trigger this most of the time, which makes me wonder whether javascript loading / execution order might have something to do with this. Any hints on when the ahoy.js methods should be called? |
You should be able to call them at any time. The library queues up events until the visit is created. |
For Rails 3, the normal ActiveRecord store will work best. Still not sure about the internal server error, but let me know if you keep seeing it with the other store. |
Thank you for the hint. I ended up overriding the track_visit and track_event methods in the ActiveRecord store, and that allowed to to finally discover the issue with disappearing id. Fixed by replacing this: visit = visit_model.new do |v| v.id = ahoy.visit_id v.visitor_id = ahoy.visitor_id v.user = user if v.respond_to?(:user=) v.started_at = options[:started_at] end with this: visit = visit_model.new( { id: ahoy.visit_id, visitor_id: ahoy.visitor_id, user: user, started_at: options[:started_at] }, :without_protection => true ) and analogically for events. I used to think the 2 forms of new were interchangeable, but I'm not digging any further - glad it finally worked! |
Cleaning up issues |
Tried to integrate ahoy 1.0.1 into a Rails 3 application running ruby 2.0.0 and connecting to Postgres 9.3 and ran into some issues, so I thought I'd ask whether these are known issues or incompatibilities.
For a start, I believe I managed to deal with the errors raised in migrations about the json & uuid tupes. Adding "serialize" to the event model fixed saving the event record. I managed to successfully record visits and events, but randomly there are exceptions and data is not saved. This is what I see in the rails log:
If it helps this is how I integrated ahoy: unepwcmc/SAPI@305cc41
Would be great to get this working! Thank you for the great work.
The text was updated successfully, but these errors were encountered: