summaryrefslogtreecommitdiff
path: root/app/services/application
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-01-27 21:56:41 -0700
committermo khan <mo@mokhan.ca>2015-01-27 21:56:41 -0700
commita03ff0d376e2ecc5006bd67a573c19d035b0c3f0 (patch)
treeef64e038e7bc7428317d86e46c14e830a561be99 /app/services/application
parent63a52f3552b940a8222a0ad2cbc647bd92175daf (diff)
collapse create cake command.
Diffstat (limited to 'app/services/application')
-rw-r--r--app/services/application/create_cake_command.rb18
1 files changed, 0 insertions, 18 deletions
diff --git a/app/services/application/create_cake_command.rb b/app/services/application/create_cake_command.rb
deleted file mode 100644
index 858c1b7c..00000000
--- a/app/services/application/create_cake_command.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-class CreateCakeCommand
- def initialize(context, current_user = context.current_user)
- @context = context
- @current_user = current_user
- end
-
- def run(attributes, tags)
- cake = @current_user.create_cake(name: attributes[:name], category: Category.find(attributes[:category_id]))
- @current_user.tag(cake, with: tags, on: :tags)
-
- if cake.save
- PublishToTwitterJob.set(wait_until: 1.hour.from_now).perform_later(cake)
- @context.create_cake_succeeded(cake)
- else
- @context.create_cake_failed(cake)
- end
- end
-end