Commit a6a88ffb
Changed files (1)
app
services
application
app/services/application/create_cake_command.rb
@@ -1,8 +1,7 @@
class CreateCakeCommand
- def initialize(context, current_user = context.current_user, command_bus = Spank::IOC.resolve(:command_bus))
+ def initialize(context, current_user = context.current_user)
@context = context
@current_user = current_user
- @command_bus = command_bus
end
def run(attributes, tags)
@@ -10,7 +9,7 @@ class CreateCakeCommand
@current_user.tag(cake, with: tags, on: :tags)
if cake.save
- @command_bus.publish(:cake_published, cake_id: cake.id)
+ PublishToTwitterJob.set(wait_until: 1.hour.from_now).perform_later(cake)
@context.create_cake_succeeded(cake)
else
@context.create_cake_failed(cake)