trailblazer-rails 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/CHANGES.md +5 -0
- data/lib/trailblazer/rails/controller.rb +6 -6
- data/lib/trailblazer/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3671c119c25e9f9f72575090dcdb7398d5c5d9f
|
4
|
+
data.tar.gz: 444bdd9e5f4737406451a8d9b65f3b99ab36cacf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39551d7596d3b73ceba16c4ca20eec455c5c1256ee91f6db0f2634ea3a3cb62dc3ef93696b2ef3a395683906b3e4d8882d32346e010f3139206024b5ae0abad0
|
7
|
+
data.tar.gz: 539c4660b17247ddfcf9f190b886ef504fddc13d3a3d069492f0314aba9e70869964aa49daa62241d6dda6a5dc8109653b6813a02a6ccdb38d9af748c5d3f257
|
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Trailblazer::Rails
|
2
2
|
module Controller
|
3
|
-
def run(operation,
|
4
|
-
result = operation.({params: _run_params(params) }.merge(*_run_runtime_options(*dependencies)))
|
3
|
+
def run(operation, *dependencies)
|
4
|
+
result = operation.({params: _run_params(self.params) }.merge(*_run_runtime_options(*dependencies)))
|
5
5
|
|
6
6
|
@model = result[:model]
|
7
7
|
@form = Trailblazer::Rails::Form.new( result[ "contract.default" ], @model.class )
|
@@ -19,14 +19,14 @@ module Trailblazer::Rails
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# This is where we can inject Dry.RB containers and the like via dependencies.
|
22
|
-
def _run_runtime_options(
|
23
|
-
[_run_options(
|
22
|
+
def _run_runtime_options(ctx={}, *dependencies)
|
23
|
+
[_run_options(ctx), *dependencies]
|
24
24
|
end
|
25
25
|
|
26
26
|
# Override this to inject dependencies such as "current_user"
|
27
27
|
# into the runtime options.
|
28
|
-
def _run_options(
|
29
|
-
|
28
|
+
def _run_options(ctx)
|
29
|
+
ctx
|
30
30
|
end
|
31
31
|
|
32
32
|
module Result
|