Sha256: c8cbc1171a4c779a064d8a8315d519fa9244ce5b898905a4386640e324619a4c

Contents?: true

Size: 360 Bytes

Versions: 18

Compression:

Stored size: 360 Bytes

Contents

module Trailblazer::Operation::Responder
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods
    def model_name
      model_class.model_name
    end
  end

  extend Forwardable
  def_delegators :@model, :to_param, :destroyed?, :persisted?

  def errors
    return [] if @valid
    [1]
  end

  def to_model
    @model
  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
trailblazer-rails-0.3.2 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.3.1 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.3.0 lib/trailblazer/operation/responder.rb
tb_heavy_control-0.0.3 lib/trailblazer/operation/responder.rb
tb_heavy_control-0.0.2 lib/trailblazer/operation/responder.rb
tb_heavy_control-0.0.1 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.2.4 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.2.3 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.2.2 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.2.1 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.2.0 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.1.6 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.1.5 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.1.4 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.1.3 lib/trailblazer/operation/responder.rb
trailblazer-rails-0.1.2 lib/trailblazer/operation/responder.rb
trailblazer-1.0.0.rc2 lib/trailblazer/operation/responder.rb
trailblazer-1.0.0.rc1 lib/trailblazer/operation/responder.rb