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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ea231527a974f62567a09d96470e63b76b4d4dc
4
- data.tar.gz: 69f01315549ff78600d26241d780ce82a05bb680
3
+ metadata.gz: ff0c272af8227151aed9bfd3117d3e9e563a2421
4
+ data.tar.gz: cfd71b052b452a8c03b9661b58c5de9780bb8a6f
5
5
  SHA512:
6
- metadata.gz: d96de3e357daa072bc382cd35e20ef70c90c7cb685a96a5a5c5351b3e275e8e5b363984e460165eca368fe3247ef3fef0dcb68544508922948499c1a8e455524
7
- data.tar.gz: d36f8d0d668865ac215bd49674132fd74bf40229fb61b12f77c16530ba00f8a0c736e613626d704c62750f1832e6b6146c3853487cb212828fac8bee31926b18
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 :parent_store, :parent_key
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
- parent = self.class.parent_adapter.get!(params[:id])
25
- self.class.adapter.create!(params.except(:id).merge(relation_id => parent.id))
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.1
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-22 00:00:00.000000000 Z
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.5
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.5
27
+ version: 0.3.6
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: tzu
30
30
  requirement: !ruby/object:Gem::Requirement