Created
June 23, 2014 20:35
-
-
Save xionon/748fe3f148ef3f37daec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensures that we can save a news item and queue up the right jobs around it | |
class NewsSaveService | |
def self.save!(news) | |
new(news).save! | |
end | |
def initialize(news) | |
@news = news | |
end | |
def save! | |
@news.class.transaction do | |
@news.save! | |
queue_send_to_listserv_job | |
queue_future_cache_expiration_job | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: