Module: Trailblazer::Operation::Model::External
- Defined in:
- lib/trailblazer/operation/model/external.rb
Overview
Builds (finds or creates) the model before the operation is instantiated. Passes the model instance into the builder with the following signature.
builds ->(model, params)
The initializer will now expect you to pass the model in via options. This happens automatically when coming from a builder.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#assign_model! ⇒ Object
i don’t like to “disable” the ‘@model =` like this but it’s the simplest for now.
Class Method Details
.included(includer) ⇒ Object
13 14 15 16 17 |
# File 'lib/trailblazer/operation/model/external.rb', line 13 def self.included(includer) includer.extend Model::DSL includer.extend Model::BuildModel includer.extend ClassMethods end |
Instance Method Details
#assign_model! ⇒ Object
i don’t like to “disable” the ‘@model =` like this but it’s the simplest for now.
19 20 21 |
# File 'lib/trailblazer/operation/model/external.rb', line 19 def assign_model!(*) # i don't like to "disable" the `@model =` like this but it's the simplest for now. @model = @options[:model] end |