activerecord_upsert 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +201 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/activerecord_upsert.gemspec +42 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/active_record_upsert.rb +21 -0
- data/lib/active_record_upsert/active_record/persistence.rb +46 -0
- data/lib/active_record_upsert/active_record/relation.rb +9 -0
- data/lib/active_record_upsert/arel/insert_manager.rb +50 -0
- data/lib/active_record_upsert/arel/insert_statement.rb +12 -0
- data/lib/active_record_upsert/arel/visitors/mysql.rb +15 -0
- data/lib/active_record_upsert/version.rb +3 -0
- data/lib/activerecord_upsert.rb +1 -0
- metadata +209 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8573e5d5eb0642aee3a01d2c5cb0dbfc4a953282e5600c567fb4f26bffc38470
|
4
|
+
data.tar.gz: a380f11680573b7dd735f838f85037577c85238fc1c66b02487659daae537be1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9df3b5e9e725e8e0cda714511180b0858ce090e4b0e98a72e8f9d30f9df2de691750ec1961c17c079f4cc07c4dbb8021ef98e50886fd3e9caa93335b64ba5c79
|
7
|
+
data.tar.gz: 98cc6703921f84910452be1731db7328b9c70aaea49dce6cd9b3922015c59c06aa772f8bd91973b98488d30108fc03b748ee4e8be23a19358a03a87fc1002044
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-performance
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.6
|
7
|
+
Exclude:
|
8
|
+
- activerecord_upsert.gemspec
|
9
|
+
- bin/*
|
10
|
+
|
11
|
+
Layout/AccessModifierIndentation:
|
12
|
+
EnforcedStyle: indent
|
13
|
+
|
14
|
+
Layout/AlignArguments:
|
15
|
+
EnforcedStyle: with_fixed_indentation
|
16
|
+
|
17
|
+
Layout/AlignHash:
|
18
|
+
EnforcedLastArgumentHashStyle: always_ignore
|
19
|
+
|
20
|
+
Layout/AlignParameters:
|
21
|
+
EnforcedStyle: with_fixed_indentation
|
22
|
+
IndentationWidth: 2
|
23
|
+
|
24
|
+
Layout/CaseIndentation:
|
25
|
+
EnforcedStyle: end
|
26
|
+
IndentOneStep: true
|
27
|
+
|
28
|
+
Layout/DotPosition:
|
29
|
+
EnforcedStyle: leading
|
30
|
+
|
31
|
+
Layout/EmptyLineAfterGuardClause:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Layout/EndAlignment:
|
38
|
+
EnforcedStyleAlignWith: variable
|
39
|
+
|
40
|
+
Layout/IndentFirstHashElement:
|
41
|
+
EnforcedStyle: consistent
|
42
|
+
|
43
|
+
Layout/MultilineMethodCallBraceLayout:
|
44
|
+
EnforcedStyle: new_line
|
45
|
+
|
46
|
+
Layout/MultilineMethodCallIndentation:
|
47
|
+
EnforcedStyle: indented
|
48
|
+
|
49
|
+
Layout/SpaceBeforeBlockBraces:
|
50
|
+
EnforcedStyle: space
|
51
|
+
EnforcedStyleForEmptyBraces: space
|
52
|
+
|
53
|
+
Layout/SpaceInLambdaLiteral:
|
54
|
+
EnforcedStyle: require_space
|
55
|
+
|
56
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
57
|
+
EnforcedStyle: no_space
|
58
|
+
|
59
|
+
Layout/SpaceInsideBlockBraces:
|
60
|
+
EnforcedStyle: space
|
61
|
+
EnforcedStyleForEmptyBraces: no_space
|
62
|
+
SpaceBeforeBlockParameters: true
|
63
|
+
|
64
|
+
Lint/AmbiguousBlockAssociation:
|
65
|
+
Exclude:
|
66
|
+
- spec/**/*
|
67
|
+
|
68
|
+
Metrics/BlockLength:
|
69
|
+
Exclude:
|
70
|
+
- spec/**/*
|
71
|
+
|
72
|
+
Metrics/LineLength:
|
73
|
+
Max: 150
|
74
|
+
IgnoreCopDirectives: true
|
75
|
+
|
76
|
+
Performance/Casecmp:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
RSpec/ContextWording:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
RSpec/DescribeClass:
|
83
|
+
Exclude:
|
84
|
+
- spec/system/**/*
|
85
|
+
|
86
|
+
RSpec/ExpectChange:
|
87
|
+
EnforcedStyle: block
|
88
|
+
|
89
|
+
RSpec/LeadingSubject:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
RSpec/LetSetup:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
RSpec/MessageSpies:
|
96
|
+
EnforcedStyle: receive
|
97
|
+
|
98
|
+
RSpec/MultipleExpectations:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
RSpec/NamedSubject:
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
RSpec/NestedGroups:
|
105
|
+
Max: 6
|
106
|
+
|
107
|
+
RSpec/NotToNot:
|
108
|
+
EnforcedStyle: to_not
|
109
|
+
|
110
|
+
RSpec/SubjectStub:
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
RSpec/VerifiedDoubles:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
Style/Alias:
|
117
|
+
EnforcedStyle: prefer_alias_method
|
118
|
+
|
119
|
+
Style/CollectionMethods:
|
120
|
+
Enabled: true
|
121
|
+
PreferredMethods:
|
122
|
+
detect: detect
|
123
|
+
reduce: inject
|
124
|
+
|
125
|
+
Style/CommentAnnotation:
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
Style/DateTime:
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Style/Documentation:
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Style/EmptyMethod:
|
135
|
+
EnforcedStyle: expanded
|
136
|
+
|
137
|
+
Style/FormatStringToken:
|
138
|
+
EnforcedStyle: template
|
139
|
+
|
140
|
+
Style/FrozenStringLiteralComment:
|
141
|
+
EnforcedStyle: never
|
142
|
+
|
143
|
+
Style/HashSyntax:
|
144
|
+
Exclude:
|
145
|
+
- 'Rakefile'
|
146
|
+
|
147
|
+
Style/MethodCallWithArgsParentheses:
|
148
|
+
Enabled: true
|
149
|
+
IgnoreMacros: true
|
150
|
+
IgnoredMethods:
|
151
|
+
- describe
|
152
|
+
- exit
|
153
|
+
- extend
|
154
|
+
- gem
|
155
|
+
- head
|
156
|
+
- helpers
|
157
|
+
- include
|
158
|
+
- load
|
159
|
+
- prepend
|
160
|
+
- raise
|
161
|
+
- require
|
162
|
+
- require_relative
|
163
|
+
- shared_examples
|
164
|
+
- sleep
|
165
|
+
- system
|
166
|
+
- throw
|
167
|
+
- to
|
168
|
+
- to_not
|
169
|
+
Exclude:
|
170
|
+
- /**/*.builder
|
171
|
+
- /**/*.jbuilder
|
172
|
+
- /**/*.rake
|
173
|
+
- Gemfile
|
174
|
+
|
175
|
+
Style/NonNilCheck:
|
176
|
+
IncludeSemanticChanges: true
|
177
|
+
|
178
|
+
Style/NumericLiterals:
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
Style/NumericPredicate:
|
182
|
+
EnforcedStyle: comparison
|
183
|
+
|
184
|
+
Style/PercentLiteralDelimiters:
|
185
|
+
PreferredDelimiters:
|
186
|
+
default: "()"
|
187
|
+
"%i": "()"
|
188
|
+
"%I": "()"
|
189
|
+
"%w": "()"
|
190
|
+
"%W": "()"
|
191
|
+
"%r": "{}"
|
192
|
+
|
193
|
+
Style/RegexpLiteral:
|
194
|
+
EnforcedStyle: mixed
|
195
|
+
AllowInnerSlashes: false
|
196
|
+
|
197
|
+
Style/SafeNavigation:
|
198
|
+
Enabled: false
|
199
|
+
|
200
|
+
Style/StabbyLambdaParentheses:
|
201
|
+
EnforcedStyle: require_parentheses
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# ActiveRecord Upsert
|
2
|
+
|
3
|
+
Adds the ability to use MySQL's `ON DUPLICATE KEY UPDATE` to upsert records in ActiveRecord.
|
4
|
+
|
5
|
+
**Note**: This will conflict with Rails 6, which adds its own upsert, so requires Rails 5.2 currently.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'activerecord_upsert'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install activerecord_upsert
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
Model.where(foo: :bar).upsert(count: 'count + 1')
|
27
|
+
```
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
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.
|
32
|
+
|
33
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord_upsert.
|
data/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'active_record_upsert/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'activerecord_upsert'
|
7
|
+
spec.version = ActiveRecordUpsert::VERSION
|
8
|
+
spec.authors = ['Daniel Vandersluis']
|
9
|
+
spec.email = ['daniel.vandersluis@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = %|Support MySQL's INSERT ... ON DUPLICATE KEY UPDATE in ActiveRecord|
|
12
|
+
spec.homepage = 'https://github.com/dvandersluis/activerecord_upsert'
|
13
|
+
|
14
|
+
if spec.respond_to?(:metadata)
|
15
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
+
spec.metadata['changelog_uri'] = "https://github.com/dvandersluis/activerecord_upsert/CHANGELOG.md"
|
17
|
+
else
|
18
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
19
|
+
'public gem pushes.'
|
20
|
+
end
|
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(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_dependency 'mysql2'
|
32
|
+
spec.add_dependency 'activerecord', '>= 5.2', '< 6'
|
33
|
+
|
34
|
+
spec.add_development_dependency('bundler', '~> 2.0')
|
35
|
+
spec.add_development_dependency('database_cleaner', '~> 1.7.0')
|
36
|
+
spec.add_development_dependency('pry', '~> 0.12.0')
|
37
|
+
spec.add_development_dependency('rake', '~> 10.0')
|
38
|
+
spec.add_development_dependency('rspec', '~> 3.0')
|
39
|
+
spec.add_development_dependency('rubocop', '~> 0.75.0')
|
40
|
+
spec.add_development_dependency('rubocop-rspec', '~> 1.36.0')
|
41
|
+
spec.add_development_dependency('rubocop-performance', '~> 1.5.0')
|
42
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "activerecord_upsert"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'active_record_upsert/version'
|
2
|
+
|
3
|
+
require 'arel'
|
4
|
+
require 'active_record'
|
5
|
+
|
6
|
+
require 'active_record_upsert/arel/insert_manager'
|
7
|
+
require 'active_record_upsert/arel/insert_statement'
|
8
|
+
require 'active_record_upsert/arel/visitors/mysql'
|
9
|
+
|
10
|
+
require 'active_record_upsert/active_record/persistence'
|
11
|
+
require 'active_record_upsert/active_record/relation'
|
12
|
+
|
13
|
+
module ActiveRecordUpsert
|
14
|
+
end
|
15
|
+
|
16
|
+
Arel::Nodes::InsertStatement.include ActiveRecordUpsert::Arel::InsertStatement
|
17
|
+
Arel::InsertManager.include ActiveRecordUpsert::Arel::InsertManager
|
18
|
+
Arel::Visitors::MySQL.prepend ActiveRecordUpsert::Arel::Visitors::MySQL
|
19
|
+
|
20
|
+
ActiveRecord::Relation.include ActiveRecordUpsert::ActiveRecord::Relation
|
21
|
+
ActiveRecord::Persistence::ClassMethods.include ActiveRecordUpsert::ActiveRecord::Persistence
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module ActiveRecordUpsert
|
2
|
+
module ActiveRecord
|
3
|
+
module Persistence
|
4
|
+
def _upsert_record(values, on_duplicate)
|
5
|
+
set_timestamps(values)
|
6
|
+
set_primary_key_value(values)
|
7
|
+
|
8
|
+
im = compile_insert(values, on_duplicate)
|
9
|
+
connection.insert(im, "#{self} Upsert", primary_key || false, values[primary_key])
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def set_timestamps(values) # rubocop:disable Naming/AccessorMethodName
|
15
|
+
return unless record_timestamps
|
16
|
+
|
17
|
+
current_time = current_time_from_proper_timezone
|
18
|
+
|
19
|
+
all_timestamp_attributes_in_model.each do |column|
|
20
|
+
values[column] = current_time unless values.include?(column)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def set_primary_key_value(values) # rubocop:disable Naming/AccessorMethodName
|
25
|
+
primary_key = self.primary_key
|
26
|
+
return unless primary_key && values.is_a?(Hash)
|
27
|
+
|
28
|
+
primary_key_value = values[primary_key]
|
29
|
+
primary_key_value ||= next_sequence_value if prefetch_primary_key?
|
30
|
+
values[primary_key] = primary_key_value
|
31
|
+
end
|
32
|
+
|
33
|
+
def compile_insert(values, on_duplicate)
|
34
|
+
if values.empty?
|
35
|
+
im = arel_table.compile_insert(connection.empty_insert_statement_value(primary_key))
|
36
|
+
im.into(arel_table)
|
37
|
+
else
|
38
|
+
im = arel_table.compile_insert(_substitute_values(values))
|
39
|
+
end
|
40
|
+
|
41
|
+
im.on_duplicate_update(on_duplicate)
|
42
|
+
im
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module ActiveRecordUpsert
|
2
|
+
module Arel
|
3
|
+
module InsertManager
|
4
|
+
def on_duplicate_update(expr = nil)
|
5
|
+
@ast.on_duplicate = OnDuplicate.new(expr, @ast.columns)
|
6
|
+
end
|
7
|
+
|
8
|
+
class OnDuplicate < ::Arel::Nodes::Node
|
9
|
+
attr_accessor :columns
|
10
|
+
|
11
|
+
def initialize(expr, columns)
|
12
|
+
@expr = expr
|
13
|
+
@columns = columns
|
14
|
+
end
|
15
|
+
|
16
|
+
def expr # rubocop:disable Metrics/MethodLength
|
17
|
+
case @expr
|
18
|
+
when nil
|
19
|
+
eq(first_col, first_col)
|
20
|
+
|
21
|
+
when String
|
22
|
+
sql(@expr)
|
23
|
+
|
24
|
+
when Hash
|
25
|
+
@expr.map do |key, val|
|
26
|
+
eq(sql(key.to_s), sql(val))
|
27
|
+
end
|
28
|
+
|
29
|
+
else
|
30
|
+
@expr
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def first_col
|
37
|
+
sql(columns.first.name.to_s)
|
38
|
+
end
|
39
|
+
|
40
|
+
def sql(stmt)
|
41
|
+
::Arel.sql(stmt)
|
42
|
+
end
|
43
|
+
|
44
|
+
def eq(left, right)
|
45
|
+
::Arel::Nodes::Equality.new(left, right)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ActiveRecordUpsert
|
2
|
+
module Arel
|
3
|
+
module Visitors
|
4
|
+
module MySQL
|
5
|
+
def visit_Arel_Nodes_InsertStatement(obj, collector) # rubocop:disable Naming/MethodName
|
6
|
+
collector = super(obj, collector)
|
7
|
+
return collector unless obj.on_duplicate
|
8
|
+
|
9
|
+
collector << ' ON DUPLICATE KEY UPDATE'
|
10
|
+
maybe_visit(obj.on_duplicate.expr, collector)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'active_record_upsert'
|
metadata
ADDED
@@ -0,0 +1,209 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord_upsert
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Vandersluis
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mysql2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.2'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '6'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '5.2'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '6'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: database_cleaner
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.7.0
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.7.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: pry
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.12.0
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.12.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rake
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '10.0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '10.0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rspec
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '3.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rubocop
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.75.0
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.75.0
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rubocop-rspec
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: 1.36.0
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 1.36.0
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: rubocop-performance
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: 1.5.0
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 1.5.0
|
159
|
+
description:
|
160
|
+
email:
|
161
|
+
- daniel.vandersluis@gmail.com
|
162
|
+
executables: []
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- ".gitignore"
|
167
|
+
- ".rspec"
|
168
|
+
- ".rubocop.yml"
|
169
|
+
- ".travis.yml"
|
170
|
+
- CHANGELOG.md
|
171
|
+
- Gemfile
|
172
|
+
- README.md
|
173
|
+
- Rakefile
|
174
|
+
- activerecord_upsert.gemspec
|
175
|
+
- bin/console
|
176
|
+
- bin/setup
|
177
|
+
- lib/active_record_upsert.rb
|
178
|
+
- lib/active_record_upsert/active_record/persistence.rb
|
179
|
+
- lib/active_record_upsert/active_record/relation.rb
|
180
|
+
- lib/active_record_upsert/arel/insert_manager.rb
|
181
|
+
- lib/active_record_upsert/arel/insert_statement.rb
|
182
|
+
- lib/active_record_upsert/arel/visitors/mysql.rb
|
183
|
+
- lib/active_record_upsert/version.rb
|
184
|
+
- lib/activerecord_upsert.rb
|
185
|
+
homepage: https://github.com/dvandersluis/activerecord_upsert
|
186
|
+
licenses: []
|
187
|
+
metadata:
|
188
|
+
homepage_uri: https://github.com/dvandersluis/activerecord_upsert
|
189
|
+
changelog_uri: https://github.com/dvandersluis/activerecord_upsert/CHANGELOG.md
|
190
|
+
post_install_message:
|
191
|
+
rdoc_options: []
|
192
|
+
require_paths:
|
193
|
+
- lib
|
194
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubygems_version: 3.0.3
|
206
|
+
signing_key:
|
207
|
+
specification_version: 4
|
208
|
+
summary: Support MySQL's INSERT ... ON DUPLICATE KEY UPDATE in ActiveRecord
|
209
|
+
test_files: []
|