collectiveidea/interactor — pull request #22 by toreyheinz (2013-10-01 09:33:59+00:00)
Title: Add success! to context

I like being able to call fail! and pass in my failure message, I would like to do the same with success!

``` ruby
class MarkOrderShipped
include Interactor

def perform
if order.shipped_at.present?
fail!(error: 'Order has already been marked as shipped')
else
order.shipped_at = Time.zone.now
order.save!
OrderMailer.ship_confirmation(order.id).deliver
# context[:notice] = "#{order.number} marked as shipped, #{order.customer.email} has been notified."
success!(notice: "#{order.number} marked as shipped, #{order.customer.email} has been notified.")
end
end
end
```