Sha256: 7d1cc7dea4ce0f301d39f84a71d4f47c169a7782a754627134658ef1d5bc051b

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

class Song::Update < Trailblazer::V2_1::Operation
  class Present < Trailblazer::V2_1::Operation
    step Model(Song, :find_by)
    step Contract::Build(constant: Song::Contract::Form)
    step Policy::Guard(:policy)

    def policy(_options, model:, current_user:, **)
      model.user_name == current_user
    end
  end

  step Nested(Present)
  step Contract::Validate()
  step Contract::Persist()
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trailblazer-future-2.1.0.rc1 test/rails5.0/app/concepts/song/operation/update.rb