Closed peterkovacs closed 8 years ago
If this PR is accepted, I have another in the conversions-for-particpants-only branch which fixes what I consider to be a bug. That is, currently conversions are recorded for all model metrics when they're created, even if created by a non-participant in an experiment.
The only problem with it is the fact that if you start any experiments before the user can be identified by their user_id
(for example) then you will still have a problem because the user_id isn't an experiment participant, but rather the users anonymous cookie identifier. Which is why I changed the after_create
callback to try to use the Vanity.context.vanity_identifier. Any objects created in the context will be associated with the correct identity and still count as conversions.
Looks like the build is still failing on the case with protected attributes.
This allows objects created on the backend (outside the ActionController) context to still have an associated identity.
Additionally, fixes a bug with the
after_create
callback so that the currentVanity.context.vanity_identity
is passed along to properly record the conversion for the participant.