Add workouts
This commit is contained in:
19
app/commands/workouts/create.rb
Normal file
19
app/commands/workouts/create.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
require "securerandom"
|
||||
require "dry/monads"
|
||||
require "filemagic"
|
||||
|
||||
module Adamantium
|
||||
module Commands
|
||||
module Workouts
|
||||
class Create < Command
|
||||
include Deps["repos.workout_repo"]
|
||||
include Dry::Monads[:result]
|
||||
|
||||
def call(svg:, distance:)
|
||||
workout_repo.create(path: svg, distance: distance, published_at: Time.now)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user