Sha256: bd44d7f913e75c544911c4d3878b58b983f78090f66ade4eac26eb3be5ea615b

Contents?: true

Size: 345 Bytes

Versions: 7

Compression:

Stored size: 345 Bytes

Contents

module Song::Operation
  class Create < Trailblazer::Operation
    step :contract
    step :model
    # step :validate
    # step :save

    def model(ctx, params:, **)
      return unless params[:id]
      ctx[:model] = Song.new(params[:id])
    end

    def contract(ctx, **)
      ctx[:contract] = Struct.new(:errors).new()
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trailblazer-endpoint-0.0.12 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.11 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.10 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.9 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.8 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.7 test/rails-app/app/concepts/song/operation/create.rb
trailblazer-endpoint-0.0.6 test/rails-app/app/concepts/song/operation/create.rb