shopapp 0.2.18 → 0.2.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 876cd7a6b9cbee9402cd690d1776cef227fb0c55896cdf6dcee6b64aac94bdaf
4
- data.tar.gz: 1ec768685ecad0f93ed1fd5849dc6c5152beb6b83096c2fe5d1d5975d072aab8
3
+ metadata.gz: 16ff0a6744cedeb53a1229529d362dbf66f5836cacdc66ffc8d7294ccd48f0fe
4
+ data.tar.gz: 810cd8b4f26f904607d8cc1921f7dd6de5f05543699c49cdf59b64b2ef43b2cc
5
5
  SHA512:
6
- metadata.gz: 6878e4cd64bc57d577f2d75e26abc7601d113a59618aee73f66075d3f08881d7155f4f19b8ca1b0bbbf63fd2ed3a15eb7669e2918d63797c1f464a083eac8870
7
- data.tar.gz: d89d1edbf5f6f013590f4d407ec8385797dcdb31e65ed041a8b4760e7d831b54b7fda0dcb2b408dd4879658f7ee39b160ec87b8ccf59443e75b28fc9d115312e
6
+ metadata.gz: 1c84b4fd1da0f510e52e0f09e2313c14ab2b5b68d101093c23b2aa15217b97331a0d6db256c34419296742f44aa16b736380f4a283bb52f8d96270b5ec2fe44c
7
+ data.tar.gz: 9264ce63dafad6db9611e6cc1078b4299b0cc8e68f3874485c593bb6c6feb250ae39a934651a03f8a106fcf480a667618133fd5c2f5af05d52aecffc489f31f6
@@ -37,6 +37,22 @@ module ShopliftClient
37
37
  end
38
38
  end
39
39
 
40
+ def company_info
41
+ return @company_info if @company_info.present?
42
+
43
+ @company_info = JSON.parse srv.get('/api/users/company_info').body
44
+ ["clients", "suppliers"].each do |partner_type|
45
+ @company_info[partner_type].each do |partner|
46
+ partner[:company] = Company.find_or_create_by! code: partner['code']
47
+ partner[:company].name = partner['name']
48
+ partner[:company].info ||= {}
49
+ partner[:company].info[:company_info] = partner['info']
50
+ partner[:company].save!
51
+ end
52
+ end
53
+ @company_info
54
+ end
55
+
40
56
  def hide_search_for_this_action
41
57
  @do_hide_search_for_this_action = true
42
58
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.2.18'
4
- s.date = '2019-01-07'
3
+ s.version = '0.2.19'
4
+ s.date = '2019-01-17'
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.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-07 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties