Commit a0ad30af
Changed files (2)
app
models
services
application
app/models/user.rb
@@ -62,8 +62,8 @@ class User < ActiveRecord::Base
favorites.includes(:creation).map {|f| f.creation }
end
- def create_cake(name:, description: nil, category:)
- creations.create(name: name, story: description, category_id: category.id)
+ def create_cake(name:, category:)
+ creations.create(name: name, category_id: category.id)
end
class << self
app/services/application/create_cake_command.rb
@@ -6,7 +6,7 @@ class CreateCakeCommand
end
def run(attributes, tags)
- cake = @current_user.create_cake(name: attributes[:name], description: attributes[:story], category: Category.find(attributes[:category_id]))
+ 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