Commit 7f97bac1

mo khan <mo@mokhan.ca>
2014-05-17 03:27:00
publish tweet to twitter in one hour from when the creation is uploaded.
1 parent cc97c0d
app/services/create_cake_command.rb
@@ -11,7 +11,7 @@ class CreateCakeCommand
     @current_user.tag(cake, with: tags, on: :tags)
 
     if cake.save
-      #@publisher.publish(cake)
+      @publisher.publish(cake)
       @context.create_cake_succeeded(cake)
     else
       @context.create_cake_failed(cake)
app/services/twitter_publisher.rb
@@ -7,7 +7,7 @@ class TwitterPublisher
     target.publish_message_with(create_client) unless Rails.env.test?
   end
 
-  handle_asynchronously :publish
+  handle_asynchronously :publish, :run_at => Proc.new { 1.hour.from_now }
 
   private