Module: Trailblazer::V1_1::Operation::Model

Includes:
BuildModel
Defined in:
lib/trailblazer/1.1/operation/model.rb,
lib/trailblazer/1.1/operation/model/dsl.rb,
lib/trailblazer/1.1/operation/model/external.rb,
lib/trailblazer/1.1/operation/model/active_model.rb

Overview

The Model module will automatically create/find models for the configured action. It adds a public Operation#model reader to access the model (after performing).

Defined Under Namespace

Modules: ActiveModel, BuildModel, DSL, External

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BuildModel

#create_model, #instantiate_model, #model!, #update_model

Class Method Details

.included(base) ⇒ Object


8
9
10
# File 'lib/trailblazer/1.1/operation/model.rb', line 8

def self.included(base)
  base.extend DSL
end

Instance Method Details

#validate(params, model = self.model, *args) ⇒ Object

#validate no longer accepts a model since this module instantiates it for you.


35
36
37
# File 'lib/trailblazer/1.1/operation/model.rb', line 35

def validate(params, model=self.model, *args)
  super(params, model, *args)
end