shopapp 0.2.31 → 0.2.32

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
  SHA256:
3
- metadata.gz: 19dd7608c5a2fec37867b2d1f3587a6b732d1e4599b32c39f29148ea524470f1
4
- data.tar.gz: 27650f702d5874f66a75945f83f3a6a8a6f5bccf9dab339288248d3e657e9595
3
+ metadata.gz: 66455468ac8b97082eedbe9f50c450cb9e3019d229b7e1e9da232481b0cfc87b
4
+ data.tar.gz: 35552b660f91d892c1fa3ad0d23de3888fe8d8b001badc8e49a33a6aea72174f
5
5
  SHA512:
6
- metadata.gz: 4454b9f13662e19cd1f35a6381e28a36e3675021b0a4b5c71fdda45b6b0703061d46ae30d8a88d9da6912d33ec3c9841a83f781adb042542ea00554d8c58b492
7
- data.tar.gz: 681733557190a46fb7ce6c9256f25d306bd47861e015c726db095eb80fc2152c92f8d10d54bdc10614c84bacc4ecfe9417f6bf3cd86bdacbb71e04e524c3569d
6
+ metadata.gz: 71d1c957bfe67238831d3676c7f1311b30e64a893762dacc32666fffbed752471765b1d7929737069196e953b333cdc6a6a77b922aec7d7670a7537c0ec30fa2
7
+ data.tar.gz: cae7485e706e24e70035bc7dfea31f4d59f3e0ab6d3c3dea046d9330f8e71610fcf9048c62e81aa759cfcd0a7ef780810a3e2596c3b99862c953150fca6587ae
@@ -38,12 +38,13 @@ module ShopliftClient
38
38
  end
39
39
  end
40
40
 
41
- def company_info
42
- return @company_info if @company_info.present?
41
+ def company_info(company_id = nil)
42
+ @company_info ||= {}
43
+ return @company_info[company_id] if @company_info[company_id].present?
43
44
 
44
- @company_info = JSON.parse srv.get('/api/users/company_info').body
45
+ @company_info[company_id] = JSON.parse srv.get(['/api/users/company_info', company_id].compact.join '/').body
45
46
  ["clients", "suppliers"].each do |partner_type|
46
- @company_info[partner_type].each do |partner|
47
+ @company_info[company_id][partner_type].each do |partner|
47
48
  partner[:company] = Company.find_or_create_by! code: partner['code']
48
49
  partner[:company].name = partner['name']
49
50
  partner[:company].info ||= {}
@@ -51,7 +52,7 @@ module ShopliftClient
51
52
  partner[:company].save!
52
53
  end
53
54
  end
54
- @company_info
55
+ @company_info[company_id]
55
56
  end
56
57
 
57
58
  def hide_search_for_this_action
data/shopapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.2.31'
4
- s.date = '2019-03-22'
3
+ s.version = '0.2.32'
4
+ s.date = '2019-03-24'
5
5
  s.summary = 'Do a shoplift.'
6
6
  s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
7
7
  I am qualmish at the smell of leek.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.31
4
+ version: 0.2.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-22 00:00:00.000000000 Z
11
+ date: 2019-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties