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

Change code to invoke mailers with ids #2806

Closed
wants to merge 2 commits into from
Closed

Change code to invoke mailers with ids #2806

wants to merge 2 commits into from

Conversation

petergoldstein
Copy link
Contributor

It's generally preferable to invoke mailers using ids. Using ids as opposed to full-blown model objects makes it easier to swap in asynchronous mailers, as only the ids need to be persisted in the back end store supporting the asynchronous mailers.

This PR includes the following changes:

  1. Spree::OrderMailer and Spree::ShipmentMailer can be invoked using either models or their ids.
  2. Methods that call methods on Spree::OrderMailer or Spree::ShipmentMailer now pass model ids as opposed to model objects
  3. Changes to the specs to validate this behavior.

…akes it easier to support asynchronous mail jobs, as only simple ids need to be persisted.
@radar
Copy link
Contributor

radar commented Apr 3, 2013

Hi @petergoldstein. This looks good to me. Would you also be able to supply a patch for master as well please?

@petergoldstein
Copy link
Contributor Author

Sure. I'll work up another PR for master. I should have it sometime tomorrow.

Will I still be able to get this merged to 1-2-stable? We're currently on the 1.2.x branch, so we need this merged there.

Thanks.

@radar
Copy link
Contributor

radar commented Apr 3, 2013

I am extremely hesitant to merge code like this to only one branch, especially an older branch. If the PR was for master I would be fine with it, but it's for 1-2-stable. If I pull this in and people use 1-2-stable and then later upgrade to a branch where it's not there, there will be anger, which is bad.

If you desperately need it right this moment then the best option is using your Spree fork until its been added.

On Wed, Apr 3, 2013 at 6:02 PM, Peter Goldstein notifications@github.com
wrote:

Sure. I'll work up another PR for master. I should have it sometime tomorrow.
Will I still be able to get this merged to 1-2-stable? We're currently on the 1.2.x branch, so we need this merged there.

Thanks.

Reply to this email directly or view it on GitHub:
#2806 (comment)

radar pushed a commit that referenced this pull request Apr 3, 2013
…akes it easier to support asynchronous mail jobs, as only simple ids need to be persisted.

Fixes #2806
radar added a commit that referenced this pull request Apr 3, 2013
Revert "Switch the mailers to be invoked using ids, not model objects. This makes it easier to support asynchronous mail jobs, as only simple ids need to be persisted."

This reverts commit a3f1d3b.
@petergoldstein
Copy link
Contributor Author

@radar I've provided a master version of this PR as #2808 . I'm not sure exactly what the merge strategy is across branches - I'd just like to make sure that this gets merged down to at least 1-2-stable, as that's the branch I'm using. Happy to provide PRs against the requisite branches to make that happen.

@radar
Copy link
Contributor

radar commented Apr 9, 2013

I've added this to 1-2-stable and your work on #2808 to 1-3-stable and master. I will run it all over the CI server now and see what it says. Thanks for your work Peter :)

radar pushed a commit that referenced this pull request Apr 10, 2013
…akes it easier to support asynchronous mail jobs, as only simple ids need to be persisted.

Fixes #2806
@radar
Copy link
Contributor

radar commented Apr 11, 2013

Hey Peter, 

This work has now been added to the 1-3-stable, 1-2-stable and master branches. Thank you for doing it for us.

On Thu, Apr 4, 2013 at 2:17 PM, Peter Goldstein notifications@github.com
wrote:

@radar I've provided a master version of this PR as #2808 . I'm not sure exactly what the merge strategy is across branches - I'd just like to make sure that this gets merged down to at least 1-2-stable, as that's the branch I'm using. Happy to provide PRs against the requisite branches to make that happen.

Reply to this email directly or view it on GitHub:
#2806 (comment)

@radar radar closed this Apr 15, 2013
@imajes imajes deleted the feature/change_mailers_to_use_ids branch May 6, 2015 15:28
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.

None yet

2 participants