activerecord-transactionable 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,17 @@
1
- require 'active_model'
2
- require 'active_record'
1
+ # frozen_string_literal: true
2
+
3
+ require "active_model"
4
+ require "active_record"
3
5
  # apparently needed for Rails 4.0 compatibility with rspec, when
4
6
  # this gem is loaded before the rails gem by bundler, as will happen when you
5
7
  # keep your Gemfile sorted alphabetically.
6
- require 'active_record/validations'
8
+ require "active_record/validations"
7
9
 
8
- require 'activerecord/transactionable/version'
9
- require 'activerecord/transactionable/result'
10
+ require "activerecord/transactionable/version"
11
+ require "activerecord/transactionable/result"
10
12
 
11
- module Activerecord # Note lowercase "r" in Activerecord (different namespace than rails' module)
13
+ # Note lowercase "r" in Activerecord (different namespace than rails' module)
14
+ module Activerecord
12
15
  # SRP: Provides an example of correct behavior for wrapping transactions.
13
16
  # NOTE: Rails' transactions are per-database connection, not per-model, nor per-instance,
14
17
  # see: http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html
@@ -48,13 +51,11 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
48
51
  outside_reraisable_errors
49
52
  outside_num_retry_attempts
50
53
  ].freeze
51
- INSIDE_CONTEXT = 'inside'.freeze
52
- OUTSIDE_CONTEXT = 'outside'.freeze
54
+ INSIDE_CONTEXT = "inside"
55
+ OUTSIDE_CONTEXT = "outside"
53
56
 
54
- def transaction_wrapper(**args)
55
- self.class.transaction_wrapper(object: self, **args) do |is_retry|
56
- yield is_retry
57
- end
57
+ def transaction_wrapper(**args, &block)
58
+ self.class.transaction_wrapper(object: self, **args, &block)
58
59
  end
59
60
 
60
61
  module ClassMethods
@@ -63,9 +64,15 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
63
64
  inside_args = extract_args(args, INSIDE_TRANSACTION_ERROR_HANDLERS)
64
65
  outside_args = extract_args(args, OUTSIDE_TRANSACTION_ERROR_HANDLERS)
65
66
  transaction_open = ActiveRecord::Base.connection.transaction_open?
66
- raise ArgumentError, "#{self} does not know how to handle arguments: #{args.keys.inspect}" unless args.keys.empty?
67
- if ERRORS_TO_DISALLOW_INSIDE_TRANSACTION.detect { |error| inside_args.values.flatten.uniq.include?(error) }
68
- raise ArgumentError, "#{self} should not rescue #{ERRORS_TO_DISALLOW_INSIDE_TRANSACTION.inspect} inside a transaction: #{inside_args.keys.inspect}"
67
+ unless args.keys.empty?
68
+ raise ArgumentError,
69
+ "#{self} does not know how to handle arguments: #{args.keys.inspect}"
70
+ end
71
+ if ERRORS_TO_DISALLOW_INSIDE_TRANSACTION.detect do |error|
72
+ inside_args.values.flatten.uniq.include?(error)
73
+ end
74
+ raise ArgumentError,
75
+ "#{self} should not rescue #{ERRORS_TO_DISALLOW_INSIDE_TRANSACTION.inspect} inside a transaction: #{inside_args.keys.inspect}"
69
76
  end
70
77
 
71
78
  transaction_args = extract_args(args, TRANSACTION_METHOD_ARG_NAMES)
@@ -77,8 +84,10 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
77
84
  logger.warn("[#{self}.transaction_wrapper] Opening a nested transaction. Setting require_new: true")
78
85
  end
79
86
  end
80
- error_handler_outside_transaction(object: object, transaction_open: transaction_open, **outside_args) do |outside_is_retry|
81
- run_inside_transaction_block(transaction_args: transaction_args, inside_args: inside_args, lock: lock, transaction_open: transaction_open, object: object) do |is_retry|
87
+ error_handler_outside_transaction(object: object, transaction_open: transaction_open,
88
+ **outside_args) do |outside_is_retry|
89
+ run_inside_transaction_block(transaction_args: transaction_args, inside_args: inside_args, lock: lock,
90
+ transaction_open: transaction_open, object: object) do |is_retry|
82
91
  # regardless of the retry being inside or outside the transaction, it is still a retry.
83
92
  yield outside_is_retry || is_retry
84
93
  end
@@ -87,30 +96,26 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
87
96
 
88
97
  private
89
98
 
90
- def run_inside_transaction_block(transaction_args:, inside_args:, lock:, transaction_open:, object: nil)
99
+ def run_inside_transaction_block(transaction_args:, inside_args:, lock:, transaction_open:, object: nil, &block)
91
100
  if object
92
101
  if lock
93
- # Note: with_lock will reload object!
102
+ # NOTE: with_lock will reload object!
94
103
  # Note: with_lock does not accept arguments like transaction does.
95
104
  object.with_lock do
96
- error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args) do |is_retry|
97
- yield is_retry
98
- end
105
+ error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args,
106
+ &block)
99
107
  end
100
108
  else
101
109
  object.transaction(**transaction_args) do
102
- error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args) do |is_retry|
103
- yield is_retry
104
- end
110
+ error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args,
111
+ &block)
105
112
  end
106
113
  end
107
114
  else
108
- raise ArgumentError, 'No object to lock!' if lock
115
+ raise ArgumentError, "No object to lock!" if lock
109
116
 
110
117
  ActiveRecord::Base.transaction(**transaction_args) do
111
- error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args) do |is_retry|
112
- yield is_retry
113
- end
118
+ error_handler_inside_transaction(object: object, transaction_open: transaction_open, **inside_args, &block)
114
119
  end
115
120
  end
116
121
  end
@@ -122,7 +127,7 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
122
127
  end
123
128
  end
124
129
 
125
- def error_handler_inside_transaction(object: nil, transaction_open:, **args)
130
+ def error_handler_inside_transaction(transaction_open:, object: nil, **args, &block)
126
131
  rescued_errors = Array(args[:rescued_errors])
127
132
  prepared_errors = Array(args[:prepared_errors])
128
133
  retriable_errors = Array(args[:retriable_errors])
@@ -130,14 +135,15 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
130
135
  num_retry_attempts = args[:num_retry_attempts] ? args[:num_retry_attempts].to_i : DEFAULT_NUM_RETRY_ATTEMPTS
131
136
  rescued_errors.concat(DEFAULT_ERRORS_TO_HANDLE_INSIDE_TRANSACTION)
132
137
  prepared_errors.concat(DEFAULT_ERRORS_PREPARE_ON_SELF_INSIDE)
133
- already_been_added_to_self, needing_added_to_self = rescued_errors.partition { |error_class| prepared_errors.include?(error_class) }
134
- local_context = INSIDE_CONTEXT
135
- run_block_with_retry(object, local_context, transaction_open, retriable_errors, reraisable_errors, already_been_added_to_self, needing_added_to_self, num_retry_attempts) do |is_retry|
136
- yield is_retry
138
+ already_been_added_to_self, needing_added_to_self = rescued_errors.partition do |error_class|
139
+ prepared_errors.include?(error_class)
137
140
  end
141
+ local_context = INSIDE_CONTEXT
142
+ run_block_with_retry(object, local_context, transaction_open, retriable_errors, reraisable_errors,
143
+ already_been_added_to_self, needing_added_to_self, num_retry_attempts, &block)
138
144
  end
139
145
 
140
- def error_handler_outside_transaction(object: nil, transaction_open:, **args)
146
+ def error_handler_outside_transaction(transaction_open:, object: nil, **args, &block)
141
147
  rescued_errors = Array(args[:outside_rescued_errors])
142
148
  prepared_errors = Array(args[:outside_prepared_errors])
143
149
  retriable_errors = Array(args[:outside_retriable_errors])
@@ -145,11 +151,12 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
145
151
  num_retry_attempts = args[:outside_num_retry_attempts] ? args[:outside_num_retry_attempts].to_i : DEFAULT_NUM_RETRY_ATTEMPTS
146
152
  rescued_errors.concat(DEFAULT_ERRORS_TO_HANDLE_OUTSIDE_TRANSACTION)
147
153
  prepared_errors.concat(DEFAULT_ERRORS_PREPARE_ON_SELF_OUTSIDE)
148
- already_been_added_to_self, needing_added_to_self = rescued_errors.partition { |error_class| prepared_errors.include?(error_class) }
149
- local_context = OUTSIDE_CONTEXT
150
- run_block_with_retry(object, local_context, transaction_open, retriable_errors, reraisable_errors, already_been_added_to_self, needing_added_to_self, num_retry_attempts) do |is_retry|
151
- yield is_retry
154
+ already_been_added_to_self, needing_added_to_self = rescued_errors.partition do |error_class|
155
+ prepared_errors.include?(error_class)
152
156
  end
157
+ local_context = OUTSIDE_CONTEXT
158
+ run_block_with_retry(object, local_context, transaction_open, retriable_errors, reraisable_errors,
159
+ already_been_added_to_self, needing_added_to_self, num_retry_attempts, &block)
153
160
  end
154
161
 
155
162
  def run_block_with_retry(object, local_context, transaction_open, retriable_errors, reraisable_errors, already_been_added_to_self, needing_added_to_self, num_retry_attempts)
@@ -173,41 +180,46 @@ module Activerecord # Note lowercase "r" in Activerecord (different namespace th
173
180
  else
174
181
  Activerecord::Transactionable::Result.new(true, context: local_context, attempt: attempt, transaction_open: transaction_open) # <= make the return value meaningful. Meaning: transaction succeeded, no errors raised
175
182
  end
176
- rescue *reraisable_errors => error
183
+ rescue *reraisable_errors => e
177
184
  # This has highest precedence because raising is the most critical functionality of a raised error to keep
178
185
  # if that is in the intended behavior, and this way a specific child of StandardError can be reraised while
179
186
  # the parent can still be caught and added to self.errors
180
187
  # Also adds the error to the object if there is an object.
181
- transaction_error_logger(object: object, error: error, result: nil, attempt: attempt, add_to: nil, additional_message: " [#{transaction_open ? 'nested ' : ''}#{local_context} re-raising!]")
182
- raise error
183
- rescue *retriable_errors => error
188
+ transaction_error_logger(object: object, error: e, result: nil, attempt: attempt, add_to: nil,
189
+ additional_message: " [#{transaction_open ? "nested " : ""}#{local_context} re-raising!]")
190
+ raise e
191
+ rescue *retriable_errors => e
184
192
  # This will re-run the begin block above
185
193
  # WARNING: If the same error keeps getting thrown this would infinitely recurse!
186
194
  # To avoid the infinite recursion, we track the retry state
187
195
  if attempt >= num_retry_attempts
188
- result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: error, attempt: attempt, type: 'retriable') # <= make the return value meaningful. Meaning is: transaction failed after <attempt> attempts
189
- transaction_error_logger(object: object, error: error, result: result, additional_message: " [#{transaction_open ? 'nested ' : ''}#{local_context}]")
196
+ result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: e, attempt: attempt, type: "retriable") # <= make the return value meaningful. Meaning is: transaction failed after <attempt> attempts
197
+ transaction_error_logger(object: object, error: e, result: result,
198
+ additional_message: " [#{transaction_open ? "nested " : ""}#{local_context}]")
190
199
  result
191
200
  else
192
201
  re_try = true
193
202
  # Not adding error to base when retrying, because otherwise the added error may
194
203
  # prevent the subsequent save from working, in a catch-22
195
- transaction_error_logger(object: object, error: error, result: nil, attempt: attempt, add_to: nil, additional_message: " [#{transaction_open ? 'nested ' : ''}#{local_context}]")
204
+ transaction_error_logger(object: object, error: e, result: nil, attempt: attempt, add_to: nil,
205
+ additional_message: " [#{transaction_open ? "nested " : ""}#{local_context}]")
196
206
  retry
197
207
  end
198
- rescue *already_been_added_to_self => error
208
+ rescue *already_been_added_to_self => e
199
209
  # ActiveRecord::RecordInvalid, when done correctly, will have already added the error to object.
200
- result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: error, attempt: attempt, type: 'already_added') # <= make the return value meaningful. Meaning is: transaction failed
201
- transaction_error_logger(object: nil, error: error, result: result, additional_message: " [#{transaction_open ? 'nested ' : ''}#{local_context}]")
210
+ result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: e, attempt: attempt, type: "already_added") # <= make the return value meaningful. Meaning is: transaction failed
211
+ transaction_error_logger(object: nil, error: e, result: result,
212
+ additional_message: " [#{transaction_open ? "nested " : ""}#{local_context}]")
202
213
  result
203
- rescue *needing_added_to_self => error
204
- result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: error, attempt: attempt, type: 'needing_added') # <= make the return value meaningful. Meaning is: transaction failed
205
- transaction_error_logger(object: object, error: error, result: result, additional_message: " [#{transaction_open ? 'nested ' : ''}#{local_context}]")
214
+ rescue *needing_added_to_self => e
215
+ result = Activerecord::Transactionable::Result.new(false, context: local_context, transaction_open: transaction_open, error: e, attempt: attempt, type: "needing_added") # <= make the return value meaningful. Meaning is: transaction failed
216
+ transaction_error_logger(object: object, error: e, result: result,
217
+ additional_message: " [#{transaction_open ? "nested " : ""}#{local_context}]")
206
218
  result
207
219
  end
208
220
  end
209
221
 
210
- def transaction_error_logger(object:, error:, result:, attempt: nil, add_to: :base, additional_message: nil, **opts)
222
+ def transaction_error_logger(object:, error:, result:, attempt: nil, add_to: :base, additional_message: nil, **_opts)
211
223
  # Ruby arguments, like object, are passed by reference,
212
224
  # so this update to errors will be available to the caller
213
225
  if object.nil?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-transactionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-13 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -39,103 +39,271 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.0.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: appraisal
42
+ name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.2'
47
+ version: '11.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.2'
54
+ version: '11.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: factory_bot
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '12.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '12.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '1.15'
89
+ version: '3.10'
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '1.15'
96
+ version: '3.10'
69
97
  - !ruby/object:Gem::Dependency
70
- name: coveralls
98
+ name: rspec-benchmark
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '0.8'
103
+ version: '0.6'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0.8'
110
+ version: '0.6'
83
111
  - !ruby/object:Gem::Dependency
84
- name: rake
112
+ name: rspec-block_is_expected
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: '12.2'
117
+ version: '1.0'
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: '12.2'
124
+ version: '1.0'
97
125
  - !ruby/object:Gem::Dependency
98
- name: rspec
126
+ name: rspec-pending_for
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.1'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.22'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.22'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-md
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-minitest
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.15'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.15'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-packaging
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.5'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.5'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-performance
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.11'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.11'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubocop-rake
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.6'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.6'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop-rspec
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '2.5'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '2.5'
237
+ - !ruby/object:Gem::Dependency
238
+ name: rubocop-thread_safety
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '0.4'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '0.4'
251
+ - !ruby/object:Gem::Dependency
252
+ name: simplecov
99
253
  requirement: !ruby/object:Gem::Requirement
100
254
  requirements:
101
255
  - - "~>"
102
256
  - !ruby/object:Gem::Version
103
- version: '3.4'
257
+ version: '0.21'
104
258
  type: :development
105
259
  prerelease: false
106
260
  version_requirements: !ruby/object:Gem::Requirement
107
261
  requirements:
108
262
  - - "~>"
109
263
  - !ruby/object:Gem::Version
110
- version: '3.4'
264
+ version: '0.21'
111
265
  - !ruby/object:Gem::Dependency
112
- name: thor
266
+ name: simplecov-cobertura
113
267
  requirement: !ruby/object:Gem::Requirement
114
268
  requirements:
115
269
  - - "~>"
116
270
  - !ruby/object:Gem::Version
117
- version: 0.19.1
271
+ version: '1.4'
118
272
  type: :development
119
273
  prerelease: false
120
274
  version_requirements: !ruby/object:Gem::Requirement
121
275
  requirements:
122
276
  - - "~>"
123
277
  - !ruby/object:Gem::Version
124
- version: 0.19.1
278
+ version: '1.4'
125
279
  - !ruby/object:Gem::Dependency
126
- name: wwtd
280
+ name: sqlite3
127
281
  requirement: !ruby/object:Gem::Requirement
128
282
  requirements:
129
283
  - - "~>"
130
284
  - !ruby/object:Gem::Version
131
- version: '1.3'
285
+ version: '1'
132
286
  type: :development
133
287
  prerelease: false
134
288
  version_requirements: !ruby/object:Gem::Requirement
135
289
  requirements:
136
290
  - - "~>"
137
291
  - !ruby/object:Gem::Version
138
- version: '1.3'
292
+ version: '1'
293
+ - !ruby/object:Gem::Dependency
294
+ name: yard
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: 0.9.20
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ version: 0.9.20
139
307
  description: Getting transactions right is hard, and this gem makes it easier.
140
308
  email:
141
309
  - peter.boling@gmail.com
@@ -143,25 +311,27 @@ executables: []
143
311
  extensions: []
144
312
  extra_rdoc_files: []
145
313
  files:
146
- - ".coveralls.yml"
314
+ - ".github/FUNDING.yml"
315
+ - ".github/dependabot.yml"
316
+ - ".github/workflows/eol.yml"
317
+ - ".github/workflows/style.yml"
318
+ - ".github/workflows/supported.yml"
319
+ - ".github/workflows/unsupported.yml"
147
320
  - ".gitignore"
148
321
  - ".rspec"
149
322
  - ".rubocop.yml"
150
- - ".travis.yml"
151
- - Appraisals
323
+ - ".rubocop_todo.yml"
324
+ - ".simplecov"
325
+ - CODE_OF_CONDUCT.md
326
+ - CONTRIBUTING.md
152
327
  - Gemfile
153
328
  - LICENSE
154
329
  - README.md
155
330
  - Rakefile
331
+ - SECURITY.md
156
332
  - activerecord-transactionable.gemspec
157
333
  - bin/console
158
334
  - bin/setup
159
- - gemfiles/rails_4_0.gemfile
160
- - gemfiles/rails_4_1.gemfile
161
- - gemfiles/rails_4_2.gemfile
162
- - gemfiles/rails_5_0.gemfile
163
- - gemfiles/rails_5_1.gemfile
164
- - gemfiles/rails_5_2.gemfile
165
335
  - lib/activerecord/transactionable.rb
166
336
  - lib/activerecord/transactionable/result.rb
167
337
  - lib/activerecord/transactionable/version.rb
@@ -169,7 +339,7 @@ homepage: http://www.railsbling.com/tags/activerecord-transactionable
169
339
  licenses:
170
340
  - MIT
171
341
  metadata: {}
172
- post_install_message:
342
+ post_install_message:
173
343
  rdoc_options: []
174
344
  require_paths:
175
345
  - lib
@@ -184,9 +354,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
354
  - !ruby/object:Gem::Version
185
355
  version: '0'
186
356
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.7.7
189
- signing_key:
357
+ rubygems_version: 3.1.6
358
+ signing_key:
190
359
  specification_version: 4
191
360
  summary: Do ActiveRecord transactions the right way.
192
361
  test_files: []
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- service_name: travis-ci
data/.travis.yml DELETED
@@ -1,50 +0,0 @@
1
- env:
2
- global:
3
- - JRUBY_OPTS="-Xcli.debug=true --debug"
4
- - CC_TEST_REPORTER_ID=3061299ce65bc5627ebbf42e64717c04e393adaa72c1abbc0ea46300d2c2fdb5
5
-
6
- before_script:
7
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
8
- - chmod +x ./cc-test-reporter
9
- - ./cc-test-reporter before-build
10
-
11
- script:
12
- - bundle exec rspec
13
-
14
- after_script:
15
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
16
-
17
- before_install:
18
- - gem update --system
19
- - gem install bundler
20
-
21
- install:
22
- - bundle install
23
-
24
- bundler_args: --no-deployment --jobs 3 --retry 3
25
-
26
- cache: bundler
27
-
28
- language: ruby
29
- sudo: false
30
- rvm:
31
- - ruby-2.1.10
32
- - ruby-2.2.10
33
- - ruby-2.3.7
34
- - ruby-2.4.4
35
- - ruby-2.5.1
36
- gemfile:
37
- - gemfiles/rails_4_0.gemfile
38
- - gemfiles/rails_4_1.gemfile
39
- - gemfiles/rails_4_2.gemfile
40
- - gemfiles/rails_5_0.gemfile
41
- - gemfiles/rails_5_1.gemfile
42
- - gemfiles/rails_5_2.gemfile
43
- matrix:
44
- exclude:
45
- - rvm: ruby-2.1.10
46
- gemfile: gemfiles/rails_5_0.gemfile
47
- - rvm: ruby-2.1.10
48
- gemfile: gemfiles/rails_5_1.gemfile
49
- - rvm: ruby-2.1.10
50
- gemfile: gemfiles/rails_5_2.gemfile
data/Appraisals DELETED
@@ -1,34 +0,0 @@
1
- appraise 'rails-4-0' do
2
- gem 'activerecord', '~> 4.0.0'
3
- gem 'activemodel', '~> 4.0.0'
4
- gem 'sqlite3', '~> 1.3'
5
- gem 'thor', '~> 0.19.1' # Because of coveralls :(
6
- end
7
-
8
- appraise 'rails-4-1' do
9
- gem 'activerecord', '~> 4.1.0'
10
- gem 'activemodel', '~> 4.1.0'
11
- gem 'sqlite3', '~> 1.3'
12
- gem 'thor', '~> 0.19.1' # Because of coveralls :(
13
- end
14
-
15
- appraise 'rails-4-2' do
16
- gem 'activerecord', '~> 4.2.0'
17
- gem 'activemodel', '~> 4.2.0'
18
- gem 'sqlite3', '~> 1.3'
19
- gem 'thor', '~> 0.19.1' # Because of coveralls :(
20
- end
21
-
22
- appraise 'rails-5-0' do
23
- gem 'activerecord', '~> 5.0.0'
24
- gem 'activemodel', '~> 5.0.0'
25
- gem 'sqlite3', '~> 1.3'
26
- gem 'thor', '~> 0.19.1' # Because of coveralls :(
27
- end
28
-
29
- appraise 'rails-5-1' do
30
- gem 'activerecord', '~> 5.1.0'
31
- gem 'activemodel', '~> 5.1.0'
32
- gem 'sqlite3', '~> 1.3'
33
- gem 'thor', '~> 0.19.1' # Because of coveralls :(
34
- end