Skip to content
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

Sailthru reintegration #169

Merged
merged 2 commits into from
Oct 17, 2012
Merged

Sailthru reintegration #169

merged 2 commits into from
Oct 17, 2012

Conversation

hsztul
Copy link
Member

@hsztul hsztul commented Oct 12, 2012

@spinosa take a look at this for me please.

updated:
now pinging sailthru to see if a user is already in our system, if so, changing their email. otherwise just adding them to our list of gt-users.

only thing i am still not sure about is whether the callback on the user model should be a before_save or after_save

i dont think that user.primary_email_changed is preserved after save, but i am having a hard time verifying this in development.

additionally, the welcome email will be sent as a rake task run via cron (which i am still working on)

thanks,

@spinosa
Copy link
Member

spinosa commented Oct 12, 2012

you should update user in after_save b/c you don't know if save will succeed in before_save. you can write a controller test to verify both cases

@hsztul
Copy link
Member Author

hsztul commented Oct 12, 2012

so after some testing (wrote a function spec for user.rb) i believe i was correct, after_save we don't have access to any properties that have changed… so trying to ping sailthru doesn't work doing things with this callback.

any thoughts on how to proceed?

scratching my head.

On Friday, October 12, 2012 at 2:18 PM, Dan Spinosa wrote:

you should update user in after_save b/c you don't know if save will succeed in before_save. you can write a controller test to verify both cases


Reply to this email directly or view it on GitHub (#169 (comment)).

@spinosa
Copy link
Member

spinosa commented Oct 12, 2012

@hsztul hsztul merged commit a638376 into master Oct 17, 2012
@hsztul
Copy link
Member Author

hsztul commented Oct 17, 2012

that did the trick. used after_update callback. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants