update_values_all 1.0.2 → 1.1.0

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: 85a13e35a594f137fea9231a1b0b38130c412487ae0b3c9934488de419022113
4
- data.tar.gz: 00ff2728e7fd0505cb767d20d4a29357abfc596b88736475baf1e35bb06bbb2d
3
+ metadata.gz: 407100066be1214e75c13c733db1fcb66ab8eae08a73d5edaf28b9fe805a54af
4
+ data.tar.gz: 4a0cb4a3f0aa7e4b9c6154ad760fe53a486b96ab96e46502f9ac4daeed6d3150
5
5
  SHA512:
6
- metadata.gz: 53f2254a4a3eb2ecfa1ba86de54d5bd3c20efd6e02b4b752dda8f0bac8b5fc6f54b2894118ad8cd43bcbaed6963b9f272ad8dd0370c603c904ef4d8cb0006819
7
- data.tar.gz: 16e08bb8ea4b8d73373c6a4013154b7b19aa7d1d27295e2ced90db2abe37d2534e5af4546e077a5585ed02af8906ca1e21e191ae5585bd1e9b80bfe466014eba
6
+ metadata.gz: b31196412dcf1f69187a979c0bde27e60262d0683ba0967be698a7768f187452720099fda52253a954539d71668879d9c7d712735af7731aa8f414ab8dbdd07a
7
+ data.tar.gz: 97f917b319a95a738fcf7d2e510a86e7b1a6e1b92fcbfbba210498e90391cb0992ba8479add5302302c52c3c10d341b5824018326a31617418c729006a25d49f
data/Gemfile.lock CHANGED
@@ -1,12 +1,15 @@
1
1
  GIT
2
2
  remote: https://github.com/corp-gp/rubocop-gp.git
3
- revision: 8002f0236b97e26586218f6cc677761d13affbdb
3
+ revision: e5bd900ce4b10077cf8f4ae88a5a6e32e7861b65
4
4
  specs:
5
- rubocop-gp (0.0.3)
5
+ rubocop-gp (0.0.4)
6
6
  rubocop
7
+ rubocop-capybara
8
+ rubocop-factory_bot
7
9
  rubocop-performance
8
10
  rubocop-rails
9
11
  rubocop-rspec
12
+ rubocop-rspec_rails
10
13
 
11
14
  PATH
12
15
  remote: .
@@ -46,7 +49,7 @@ GEM
46
49
  activesupport (>= 3.0.0)
47
50
  railties (>= 3.0.0)
48
51
  thor (>= 0.14.6)
49
- concurrent-ruby (1.2.2)
52
+ concurrent-ruby (1.3.4)
50
53
  crass (1.0.6)
51
54
  diff-lcs (1.5.0)
52
55
  dotenv (2.8.1)
@@ -54,23 +57,27 @@ GEM
54
57
  dotenv (= 2.8.1)
55
58
  railties (>= 3.2)
56
59
  erubi (1.12.0)
57
- i18n (1.12.0)
60
+ i18n (1.14.5)
58
61
  concurrent-ruby (~> 1.0)
59
- json (2.6.3)
62
+ json (2.7.2)
63
+ language_server-protocol (3.17.0.3)
60
64
  lefthook (1.3.8)
61
65
  loofah (2.19.1)
62
66
  crass (~> 1.0.2)
63
67
  nokogiri (>= 1.5.9)
64
68
  method_source (1.0.0)
65
- minitest (5.18.0)
66
- nokogiri (1.14.2-x86_64-linux)
69
+ minitest (5.25.1)
70
+ nokogiri (1.16.7-arm64-darwin)
67
71
  racc (~> 1.4)
68
- parallel (1.22.1)
69
- parser (3.2.1.1)
72
+ nokogiri (1.16.7-x86_64-linux)
73
+ racc (~> 1.4)
74
+ parallel (1.26.3)
75
+ parser (3.3.4.2)
70
76
  ast (~> 2.4.1)
77
+ racc
71
78
  pg (1.4.6)
72
- racc (1.6.2)
73
- rack (2.2.6.4)
79
+ racc (1.8.1)
80
+ rack (2.2.9)
74
81
  rack-test (2.1.0)
75
82
  rack (>= 1.3)
76
83
  rails-dom-testing (2.0.3)
@@ -87,8 +94,9 @@ GEM
87
94
  zeitwerk (~> 2.5)
88
95
  rainbow (3.1.1)
89
96
  rake (13.0.6)
90
- regexp_parser (2.7.0)
91
- rexml (3.2.5)
97
+ regexp_parser (2.9.2)
98
+ rexml (3.3.6)
99
+ strscan
92
100
  rspec (3.11.0)
93
101
  rspec-core (~> 3.11.0)
94
102
  rspec-expectations (~> 3.11.0)
@@ -110,38 +118,46 @@ GEM
110
118
  rspec-mocks (~> 3.11)
111
119
  rspec-support (~> 3.11)
112
120
  rspec-support (3.11.0)
113
- rubocop (1.48.1)
121
+ rubocop (1.65.1)
114
122
  json (~> 2.3)
123
+ language_server-protocol (>= 3.17.0)
115
124
  parallel (~> 1.10)
116
- parser (>= 3.2.0.0)
125
+ parser (>= 3.3.0.2)
117
126
  rainbow (>= 2.2.2, < 4.0)
118
- regexp_parser (>= 1.8, < 3.0)
127
+ regexp_parser (>= 2.4, < 3.0)
119
128
  rexml (>= 3.2.5, < 4.0)
120
- rubocop-ast (>= 1.26.0, < 2.0)
129
+ rubocop-ast (>= 1.31.1, < 2.0)
121
130
  ruby-progressbar (~> 1.7)
122
131
  unicode-display_width (>= 2.4.0, < 3.0)
123
- rubocop-ast (1.28.0)
124
- parser (>= 3.2.1.0)
125
- rubocop-capybara (2.17.1)
132
+ rubocop-ast (1.32.1)
133
+ parser (>= 3.3.1.0)
134
+ rubocop-capybara (2.21.0)
126
135
  rubocop (~> 1.41)
127
- rubocop-performance (1.16.0)
128
- rubocop (>= 1.7.0, < 2.0)
129
- rubocop-ast (>= 0.4.0)
130
- rubocop-rails (2.18.0)
136
+ rubocop-factory_bot (2.26.1)
137
+ rubocop (~> 1.61)
138
+ rubocop-performance (1.21.1)
139
+ rubocop (>= 1.48.1, < 2.0)
140
+ rubocop-ast (>= 1.31.1, < 2.0)
141
+ rubocop-rails (2.26.0)
131
142
  activesupport (>= 4.2.0)
132
143
  rack (>= 1.1)
133
- rubocop (>= 1.33.0, < 2.0)
134
- rubocop-rspec (2.19.0)
135
- rubocop (~> 1.33)
136
- rubocop-capybara (~> 2.17)
144
+ rubocop (>= 1.52.0, < 2.0)
145
+ rubocop-ast (>= 1.31.1, < 2.0)
146
+ rubocop-rspec (3.0.4)
147
+ rubocop (~> 1.61)
148
+ rubocop-rspec_rails (2.30.0)
149
+ rubocop (~> 1.61)
150
+ rubocop-rspec (~> 3, >= 3.0.1)
137
151
  ruby-progressbar (1.13.0)
152
+ strscan (3.1.0)
138
153
  thor (1.2.1)
139
154
  tzinfo (2.0.6)
140
155
  concurrent-ruby (~> 1.0)
141
- unicode-display_width (2.4.2)
156
+ unicode-display_width (2.5.0)
142
157
  zeitwerk (2.6.7)
143
158
 
144
159
  PLATFORMS
160
+ arm64-darwin-23
145
161
  x86_64-linux
146
162
 
147
163
  DEPENDENCIES
data/README.md CHANGED
@@ -38,7 +38,7 @@ changed_ids =
38
38
  { id: 1, address: { city: 'Berlin' }, name: 'Hanz' },
39
39
  { id: 2, address: { city: 'London' }, name: 'John' }
40
40
  ],
41
- key_to_match: :id,
41
+ key_to_match: :id, # :key_to_match can be omitted if it matches primary key
42
42
  )
43
43
  ```
44
44
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'update_values_all/adapters/postgres'
3
+ require "update_values_all/adapters/postgres"
4
4
 
5
5
  module UpdateValuesAll
6
6
  module BatchUpdate
@@ -14,6 +14,8 @@ module UpdateValuesAll
14
14
  def update_values_all(data, **keyword_args)
15
15
  return [] if data.empty?
16
16
 
17
+ keyword_args[:key_to_match] ||= primary_key
18
+
17
19
  if defined?(::PG::Connection) && connection.raw_connection.is_a?(::PG::Connection)
18
20
  pg_update_values_all(data, **keyword_args)
19
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module UpdateValuesAll
4
4
 
5
- VERSION = '1.0.2'
5
+ VERSION = '1.1.0'
6
6
 
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: update_values_all
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei Malykh
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-29 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
- description:
27
+ description:
28
28
  email:
29
29
  - xronos.i.am@gmail.com
30
30
  executables: []
@@ -48,7 +48,6 @@ files:
48
48
  - lib/update_values_all/batch_update.rb
49
49
  - lib/update_values_all/railtie.rb
50
50
  - lib/update_values_all/version.rb
51
- - update_values_all.gemspec
52
51
  homepage: https://github.com/corp-gp/update_values_all
53
52
  licenses:
54
53
  - MIT
@@ -58,7 +57,7 @@ metadata:
58
57
  source_code_uri: https://github.com/corp-gp/update_values_all
59
58
  changelog_uri: https://github.com/corp-gp/update_values_all/CHANGELOG.md
60
59
  rubygems_mfa_required: 'true'
61
- post_install_message:
60
+ post_install_message:
62
61
  rdoc_options: []
63
62
  require_paths:
64
63
  - lib
@@ -73,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
72
  - !ruby/object:Gem::Version
74
73
  version: '0'
75
74
  requirements: []
76
- rubygems_version: 3.4.6
77
- signing_key:
75
+ rubygems_version: 3.3.17
76
+ signing_key:
78
77
  specification_version: 4
79
78
  summary: The gem allows to update AR-records in batch
80
79
  test_files: []
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/update_values_all/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'update_values_all'
7
- spec.version = UpdateValuesAll::VERSION
8
- spec.authors = ['Sergei Malykh']
9
- spec.email = ['xronos.i.am@gmail.com']
10
-
11
- spec.summary = 'The gem allows to update AR-records in batch'
12
- spec.homepage = 'https://github.com/corp-gp/update_values_all'
13
- spec.license = 'MIT'
14
- spec.required_ruby_version = '>= 2.7.0'
15
-
16
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
17
-
18
- spec.metadata['homepage_uri'] = spec.homepage
19
- spec.metadata['source_code_uri'] = 'https://github.com/corp-gp/update_values_all'
20
- spec.metadata['changelog_uri'] = 'https://github.com/corp-gp/update_values_all/CHANGELOG.md'
21
-
22
- # Specify which files should be added to the gem when it is released.
23
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
- spec.files =
25
- Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
28
- end
29
- end
30
- spec.require_paths = ['lib']
31
-
32
- spec.add_dependency 'activerecord', '>= 4.2'
33
-
34
- # For more information and examples about making a new gem, check out our
35
- # guide at: https://bundler.io/guides/creating_gem.html
36
- spec.metadata['rubygems_mfa_required'] = 'true'
37
- end