update_values_all 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a330d34e5e9fe0ebdc3a414b50f21a6ebfa2bb90f49f8fd5bdb144427da7dcb6
4
+ data.tar.gz: 82f95dfcb04cfa99e11a5fbe34312373e4c6d38461c4d7dac5f19e30d098137a
5
+ SHA512:
6
+ metadata.gz: ef94276838c219aa6f44dc142e0f009dcfa03e4f4c91118a4efce8863d24550ded1d9a546acfa84b9ec1f9b018fe402db739808e3a1fb8333f59882846a95c80
7
+ data.tar.gz: 0a0e9a6ffc8d4aa34cb328e1f134e8b51a0728f02c2d81be8513073c98cab8e1ce19190f3656315389c045f79f478385376b6d03ee53d683d33351935bcf7074
data/.editorconfig ADDED
@@ -0,0 +1,6 @@
1
+ [*]
2
+ indent_style = space
3
+ indent_size = 2
4
+ end_of_line = lf
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
data/.env.sample ADDED
@@ -0,0 +1,5 @@
1
+ POSTGRES_DB=test_db
2
+ POSTGRES_USER=postgres
3
+ POSTGRES_PASSWORD=postgres
4
+ POSTGRES_HOST=localhost
5
+ POSTGRES_PORT=5432
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ inherit_gem:
2
+ rubocop-gp:
3
+ - ./config/default.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.7
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [1.0.0] - 2023-03-27
2
+
3
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at xronos.i.am@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in update_values_all.gemspec
6
+ gemspec
7
+
8
+ gem 'combustion'
9
+ gem 'dotenv-rails'
10
+ gem 'lefthook', require: false
11
+ gem 'pg'
12
+ gem 'rspec'
13
+ gem 'rspec-rails'
14
+ gem 'rubocop-gp', github: 'corp-gp/rubocop-gp', require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,158 @@
1
+ GIT
2
+ remote: https://github.com/corp-gp/rubocop-gp.git
3
+ revision: 8002f0236b97e26586218f6cc677761d13affbdb
4
+ specs:
5
+ rubocop-gp (0.0.3)
6
+ rubocop
7
+ rubocop-performance
8
+ rubocop-rails
9
+ rubocop-rspec
10
+
11
+ PATH
12
+ remote: .
13
+ specs:
14
+ update_values_all (1.0.0)
15
+ activerecord (>= 4.2)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ actionpack (7.0.4.3)
21
+ actionview (= 7.0.4.3)
22
+ activesupport (= 7.0.4.3)
23
+ rack (~> 2.0, >= 2.2.0)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
27
+ actionview (7.0.4.3)
28
+ activesupport (= 7.0.4.3)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
33
+ activemodel (7.0.4.3)
34
+ activesupport (= 7.0.4.3)
35
+ activerecord (7.0.4.3)
36
+ activemodel (= 7.0.4.3)
37
+ activesupport (= 7.0.4.3)
38
+ activesupport (7.0.4.3)
39
+ concurrent-ruby (~> 1.0, >= 1.0.2)
40
+ i18n (>= 1.6, < 2)
41
+ minitest (>= 5.1)
42
+ tzinfo (~> 2.0)
43
+ ast (2.4.2)
44
+ builder (3.2.4)
45
+ combustion (1.3.7)
46
+ activesupport (>= 3.0.0)
47
+ railties (>= 3.0.0)
48
+ thor (>= 0.14.6)
49
+ concurrent-ruby (1.2.2)
50
+ crass (1.0.6)
51
+ diff-lcs (1.5.0)
52
+ dotenv (2.8.1)
53
+ dotenv-rails (2.8.1)
54
+ dotenv (= 2.8.1)
55
+ railties (>= 3.2)
56
+ erubi (1.12.0)
57
+ i18n (1.12.0)
58
+ concurrent-ruby (~> 1.0)
59
+ json (2.6.3)
60
+ lefthook (1.3.8)
61
+ loofah (2.19.1)
62
+ crass (~> 1.0.2)
63
+ nokogiri (>= 1.5.9)
64
+ method_source (1.0.0)
65
+ minitest (5.18.0)
66
+ nokogiri (1.14.2-x86_64-linux)
67
+ racc (~> 1.4)
68
+ parallel (1.22.1)
69
+ parser (3.2.1.1)
70
+ ast (~> 2.4.1)
71
+ pg (1.4.6)
72
+ racc (1.6.2)
73
+ rack (2.2.6.4)
74
+ rack-test (2.1.0)
75
+ rack (>= 1.3)
76
+ rails-dom-testing (2.0.3)
77
+ activesupport (>= 4.2.0)
78
+ nokogiri (>= 1.6)
79
+ rails-html-sanitizer (1.5.0)
80
+ loofah (~> 2.19, >= 2.19.1)
81
+ railties (7.0.4.3)
82
+ actionpack (= 7.0.4.3)
83
+ activesupport (= 7.0.4.3)
84
+ method_source
85
+ rake (>= 12.2)
86
+ thor (~> 1.0)
87
+ zeitwerk (~> 2.5)
88
+ rainbow (3.1.1)
89
+ rake (13.0.6)
90
+ regexp_parser (2.7.0)
91
+ rexml (3.2.5)
92
+ rspec (3.11.0)
93
+ rspec-core (~> 3.11.0)
94
+ rspec-expectations (~> 3.11.0)
95
+ rspec-mocks (~> 3.11.0)
96
+ rspec-core (3.11.0)
97
+ rspec-support (~> 3.11.0)
98
+ rspec-expectations (3.11.0)
99
+ diff-lcs (>= 1.2.0, < 2.0)
100
+ rspec-support (~> 3.11.0)
101
+ rspec-mocks (3.11.1)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.11.0)
104
+ rspec-rails (6.0.1)
105
+ actionpack (>= 6.1)
106
+ activesupport (>= 6.1)
107
+ railties (>= 6.1)
108
+ rspec-core (~> 3.11)
109
+ rspec-expectations (~> 3.11)
110
+ rspec-mocks (~> 3.11)
111
+ rspec-support (~> 3.11)
112
+ rspec-support (3.11.0)
113
+ rubocop (1.48.1)
114
+ json (~> 2.3)
115
+ parallel (~> 1.10)
116
+ parser (>= 3.2.0.0)
117
+ rainbow (>= 2.2.2, < 4.0)
118
+ regexp_parser (>= 1.8, < 3.0)
119
+ rexml (>= 3.2.5, < 4.0)
120
+ rubocop-ast (>= 1.26.0, < 2.0)
121
+ ruby-progressbar (~> 1.7)
122
+ 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)
126
+ 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)
131
+ activesupport (>= 4.2.0)
132
+ 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)
137
+ ruby-progressbar (1.13.0)
138
+ thor (1.2.1)
139
+ tzinfo (2.0.6)
140
+ concurrent-ruby (~> 1.0)
141
+ unicode-display_width (2.4.2)
142
+ zeitwerk (2.6.7)
143
+
144
+ PLATFORMS
145
+ x86_64-linux
146
+
147
+ DEPENDENCIES
148
+ combustion
149
+ dotenv-rails
150
+ lefthook
151
+ pg
152
+ rspec
153
+ rspec-rails
154
+ rubocop-gp!
155
+ update_values_all!
156
+
157
+ BUNDLED WITH
158
+ 2.4.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Sergei Malykh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # UpdateValuesAll
2
+
3
+ The gem allows to update AR-records in batch
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add update_values_all
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install update_values_all
14
+
15
+ ## Usage
16
+
17
+ Assume you have AR-model
18
+
19
+ ```ruby
20
+ class User < ActiveRecord::Base
21
+ store :address, accessors: %i[city]
22
+ end
23
+ ```
24
+
25
+ And some records
26
+
27
+ ```ruby
28
+ User.create!(id: 1, city: 'Moscow', name: 'Ivan')
29
+ User.create!(id: 2, city: 'Vladivostok', name: 'Petr')
30
+ ```
31
+
32
+ The gem defines method `User.update_values_all` which allows to batch update attributes
33
+
34
+ ```ruby
35
+ changed_ids =
36
+ User.update_values_all(
37
+ [
38
+ { id: 1, address: { city: 'Berlin' }, name: 'Hanz' },
39
+ { id: 2, address: { city: 'London' }, name: 'John' }
40
+ ],
41
+ key_to_match: :id,
42
+ )
43
+ ```
44
+
45
+ ```
46
+ changed_ids # [1, 2]
47
+ User.find(1).name # Hanz
48
+ User.find(1).city # Berlin
49
+ User.find(2).name # John
50
+ User.find(2).city # London
51
+ ```
52
+
53
+ Records are only updated if attributes changed (and also `updated_at`).
54
+
55
+ Sometimes you want to update `updated_at` regardless of whether the attributes have changed. In that case you may pass param `touch: true`.
56
+
57
+ ```ruby
58
+ changed_ids = User.update_values_all([{ id: 1, name: 'Hanz' }], key_to_match: :id, touch: true)
59
+ ```
60
+
61
+ ```
62
+ changed_ids = []
63
+ User.find(1).updated_at # changed
64
+ ```
65
+
66
+ ## Development
67
+
68
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
69
+
70
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+
72
+ ## Contributing
73
+
74
+ Bug reports and pull requests are welcome on GitHub at https://github.com/corp-gp/update_values_all. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/corp-gp/update_values_all/blob/master/CODE_OF_CONDUCT.md).
75
+
76
+ ## License
77
+
78
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
79
+
80
+ ## Code of Conduct
81
+
82
+ Everyone interacting in the UpdateValuesAll project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/corp-gp/update_values_all/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/lefthook.yml ADDED
@@ -0,0 +1,5 @@
1
+ pre-commit:
2
+ commands:
3
+ rubocop:
4
+ glob: "*.rb"
5
+ run: bundle exec rubocop --autocorrect-all --fail-level A --color --display-style-guide --force-exclusion {staged_files}
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UpdateValuesAll
4
+ module Adapters
5
+ module Postgres
6
+
7
+ def update_values_all(data, key_to_match:, touch: false, sql_update_expression: 'updated_at = CURRENT_TIMESTAMP')
8
+ keys = data.first.keys
9
+
10
+ sql_values = +''
11
+ data.each do |hash_row|
12
+ hash_keys = []
13
+ serialize_row =
14
+ hash_row.map do |column_name, value|
15
+ hash_keys << column_name
16
+ column_type = type_for_attribute(column_name)
17
+ connection.quote(column_type.serialize(value))
18
+ end
19
+
20
+ raise KeyError, "Wrong keys: #{(hash_keys - keys) | (keys - hash_keys)}" if hash_keys != keys
21
+
22
+ sql_values << "(#{serialize_row.join(', ')}),"
23
+ end
24
+ sql_values.chop!
25
+
26
+ updated_keys = keys.join(', ')
27
+
28
+ sql_types = data[0].keys.index_with { |column_name| column_for_attribute(column_name).sql_type_metadata.sql_type }
29
+ set_expr =
30
+ if block_given?
31
+ +yield
32
+ else
33
+ keys
34
+ .reject { |key| key == key_to_match }
35
+ .map { |key| "#{key} = updated_data.#{key}::#{sql_types[key]}" }
36
+ .join(', ')
37
+ end
38
+ only_changed_expr =
39
+ if touch
40
+ 'TRUE'
41
+ else
42
+ keys
43
+ .reject { |key| key == key_to_match }
44
+ .map { |key| "#{table_name}.#{key} IS DISTINCT FROM updated_data.#{key}::#{sql_types[key]}" }
45
+ .join(' OR ')
46
+ end
47
+
48
+ if sql_update_expression.present?
49
+ set_expr << ", #{sql_update_expression}"
50
+ end
51
+
52
+ existing_data_sql =
53
+ select("#{table_name}.#{key_to_match}") # rubocop:disable Gp/PotentialSqlInjection
54
+ .where("#{key_to_match} IN (SELECT #{key_to_match} FROM updated_data)")
55
+ .to_sql
56
+
57
+ changed_ids =
58
+ connection.query(<<~SQL).flatten # rubocop:disable Gp/PotentialSqlInjection
59
+ WITH
60
+ updated_data(#{updated_keys}) AS (
61
+ VALUES #{sql_values}
62
+ ),
63
+ existing_data AS (
64
+ #{existing_data_sql}
65
+ )
66
+ UPDATE #{table_name}
67
+ SET #{set_expr}
68
+ FROM updated_data JOIN existing_data ON existing_data.#{key_to_match} = updated_data.#{key_to_match}
69
+ WHERE
70
+ updated_data.#{key_to_match} = #{table_name}.#{key_to_match}
71
+ AND #{table_name}.#{key_to_match} = existing_data.#{key_to_match}
72
+ AND (#{only_changed_expr})
73
+ RETURNING #{table_name}.#{key_to_match}
74
+ SQL
75
+
76
+ connection.query_cache.clear if connection.query_cache_enabled
77
+
78
+ changed_ids
79
+ end
80
+
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UpdateValuesAll
4
+ module BatchUpdate
5
+
6
+ def self.extended(active_record_base)
7
+ active_record_base.define_singleton_method(:inherited) do |subclass|
8
+ super(subclass)
9
+
10
+ case subclass.connection.raw_connection
11
+ when ::PG::Connection
12
+ subclass.extend UpdateValuesAll::Adapters::Postgres
13
+ end
14
+ end
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UpdateValuesAll
4
+ class Railtie < ::Rails::Railtie
5
+
6
+ initializer 'update_values_all.initialize' do
7
+ ActiveSupport.on_load(:active_record) { extend UpdateValuesAll::BatchUpdate }
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UpdateValuesAll
4
+
5
+ VERSION = '1.0.0'
6
+
7
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'update_values_all/version'
4
+ require_relative 'update_values_all/railtie'
5
+
6
+ module UpdateValuesAll
7
+
8
+ autoload :BatchUpdate, 'update_values_all/batch_update'
9
+
10
+ module Adapters
11
+
12
+ autoload :Postgres, 'update_values_all/adapters/postgres'
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,36 @@
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 = Dir.chdir(__dir__) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
27
+ end
28
+ end
29
+ spec.require_paths = ['lib']
30
+
31
+ spec.add_dependency 'activerecord', '>= 4.2'
32
+
33
+ # For more information and examples about making a new gem, check out our
34
+ # guide at: https://bundler.io/guides/creating_gem.html
35
+ spec.metadata['rubygems_mfa_required'] = 'true'
36
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: update_values_all
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sergei Malykh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-03-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ description:
28
+ email:
29
+ - xronos.i.am@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".editorconfig"
35
+ - ".env.sample"
36
+ - ".rspec"
37
+ - ".rubocop.yml"
38
+ - CHANGELOG.md
39
+ - CODE_OF_CONDUCT.md
40
+ - Gemfile
41
+ - Gemfile.lock
42
+ - LICENSE.txt
43
+ - README.md
44
+ - Rakefile
45
+ - lefthook.yml
46
+ - lib/update_values_all.rb
47
+ - lib/update_values_all/adapters/postgres.rb
48
+ - lib/update_values_all/batch_update.rb
49
+ - lib/update_values_all/railtie.rb
50
+ - lib/update_values_all/version.rb
51
+ - update_values_all.gemspec
52
+ homepage: https://github.com/corp-gp/update_values_all
53
+ licenses:
54
+ - MIT
55
+ metadata:
56
+ allowed_push_host: https://rubygems.org
57
+ homepage_uri: https://github.com/corp-gp/update_values_all
58
+ source_code_uri: https://github.com/corp-gp/update_values_all
59
+ changelog_uri: https://github.com/corp-gp/update_values_all/CHANGELOG.md
60
+ rubygems_mfa_required: 'true'
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 2.7.0
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.4.6
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: The gem allows to update AR-records in batch
80
+ test_files: []