tradesman 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tradesman/builders/create_for_parent.rb +6 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff0c272af8227151aed9bfd3117d3e9e563a2421
|
4
|
+
data.tar.gz: cfd71b052b452a8c03b9661b58c5de9780bb8a6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cda47f9fbfa8af03503eefc79f27752efa57688c02a847a30fa909cc6d5576bdcefea4e296b44925b42c87fae104d6850778d8c0133105c8fc069411a31bfc45
|
7
|
+
data.tar.gz: 507e619be7e917d84a4c4d657c7e2b77d3a22fa346a3bd40b94fce02383f43d83c3afb0a409cf3dbe91d42a7c450c2ee88151f13df70acb70b4f61313fc64d1a
|
@@ -7,22 +7,20 @@ module Tradesman
|
|
7
7
|
Class.new(::Tradesman::Template) do
|
8
8
|
include ::Tradesman::ExistingRecordsMultipleExecute
|
9
9
|
@store = Tradesman.adapter.context_for_entity(args[:subject])
|
10
|
-
@parent_store = Tradesman.adapter.context_for_entity(args[:parent])
|
11
10
|
@parent_key = args[:parent]
|
12
11
|
|
13
12
|
class << self
|
14
|
-
attr_reader :
|
15
|
-
|
16
|
-
def parent_adapter
|
17
|
-
Tradesman.adapter.new(parent_store)
|
18
|
-
end
|
13
|
+
attr_reader :parent_key
|
19
14
|
end
|
20
15
|
|
21
16
|
private
|
22
17
|
|
23
18
|
def execute_single(params)
|
24
|
-
|
25
|
-
|
19
|
+
self.class.adapter.create_as_child!(parent_args(params), params.except(:id))
|
20
|
+
end
|
21
|
+
|
22
|
+
def parent_args(params)
|
23
|
+
{ klass: self.class.parent_key, id: params[:id] }
|
26
24
|
end
|
27
25
|
|
28
26
|
def relation_id
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tradesman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Turner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: horza
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.3.
|
20
|
+
version: 0.3.6
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.3.
|
27
|
+
version: 0.3.6
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: tzu
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|