Skip to content

@iain /publishes_post.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class PublishesPost
def self.call(*args)
new(*args).call
end
attr_reader :post, :user
def initialize(post, user)
@post, @user = post, user
end
def call
post.publish(user)
send_notifications
end
private
def send_notification
# ...
end
end
class PublishesPost
def self.call(post, user)
post.publish(user)
PublicationMailer.deliver(post) # or whatever was inside .send_notifications
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.