audited 5.0.0 → 5.8.0

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +40 -17
  3. data/CHANGELOG.md +143 -0
  4. data/README.md +49 -15
  5. data/Rakefile +1 -3
  6. data/audited.gemspec +38 -0
  7. data/lib/audited/audit.rb +8 -4
  8. data/lib/audited/auditor.rb +124 -38
  9. data/lib/audited/version.rb +1 -1
  10. data/lib/audited.rb +19 -10
  11. data/lib/generators/audited/migration.rb +10 -2
  12. metadata +39 -56
  13. data/.gitignore +0 -17
  14. data/.standard.yml +0 -5
  15. data/.travis.yml +0 -67
  16. data/.yardopts +0 -3
  17. data/gemfiles/rails50.gemfile +0 -10
  18. data/gemfiles/rails51.gemfile +0 -10
  19. data/gemfiles/rails52.gemfile +0 -10
  20. data/gemfiles/rails60.gemfile +0 -10
  21. data/gemfiles/rails61.gemfile +0 -10
  22. data/spec/audited/audit_spec.rb +0 -357
  23. data/spec/audited/auditor_spec.rb +0 -1097
  24. data/spec/audited/rspec_matchers_spec.rb +0 -69
  25. data/spec/audited/sweeper_spec.rb +0 -133
  26. data/spec/audited_spec.rb +0 -18
  27. data/spec/audited_spec_helpers.rb +0 -32
  28. data/spec/rails_app/app/assets/config/manifest.js +0 -2
  29. data/spec/rails_app/config/application.rb +0 -13
  30. data/spec/rails_app/config/database.yml +0 -25
  31. data/spec/rails_app/config/environment.rb +0 -5
  32. data/spec/rails_app/config/environments/test.rb +0 -47
  33. data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  34. data/spec/rails_app/config/initializers/inflections.rb +0 -2
  35. data/spec/rails_app/config/initializers/secret_token.rb +0 -3
  36. data/spec/rails_app/config/routes.rb +0 -3
  37. data/spec/spec_helper.rb +0 -24
  38. data/spec/support/active_record/models.rb +0 -151
  39. data/spec/support/active_record/postgres/1_change_audited_changes_type_to_json.rb +0 -11
  40. data/spec/support/active_record/postgres/2_change_audited_changes_type_to_jsonb.rb +0 -11
  41. data/spec/support/active_record/schema.rb +0 -90
  42. data/test/db/version_1.rb +0 -17
  43. data/test/db/version_2.rb +0 -18
  44. data/test/db/version_3.rb +0 -18
  45. data/test/db/version_4.rb +0 -19
  46. data/test/db/version_5.rb +0 -17
  47. data/test/db/version_6.rb +0 -19
  48. data/test/install_generator_test.rb +0 -62
  49. data/test/test_helper.rb +0 -18
  50. data/test/upgrade_generator_test.rb +0 -97
@@ -13,7 +13,7 @@ module Audited
13
13
  #
14
14
  # See <tt>Audited::Auditor::ClassMethods#audited</tt>
15
15
  # for configuration options
16
- module Auditor #:nodoc:
16
+ module Auditor # :nodoc:
17
17
  extend ActiveSupport::Concern
18
18
 
19
19
  CALLBACKS = [:audit_create, :audit_update, :audit_destroy]
@@ -59,9 +59,16 @@ module Audited
59
59
  # end
60
60
  #
61
61
  def audited(options = {})
62
- # don't allow multiple calls
63
- return if included_modules.include?(Audited::Auditor::AuditedInstanceMethods)
62
+ audited? ? update_audited_options(options) : set_audit(options)
63
+ end
64
+
65
+ private
64
66
 
67
+ def audited?
68
+ included_modules.include?(Audited::Auditor::AuditedInstanceMethods)
69
+ end
70
+
71
+ def set_audit(options)
65
72
  extend Audited::Auditor::AuditedClassMethods
66
73
  include Audited::Auditor::AuditedInstanceMethods
67
74
 
@@ -69,10 +76,7 @@ module Audited
69
76
  class_attribute :audited_options, instance_writer: false
70
77
  attr_accessor :audit_version, :audit_comment
71
78
 
72
- self.audited_options = options
73
- normalize_audited_options
74
-
75
- self.audit_associated_with = audited_options[:associated_with]
79
+ set_audited_options(options)
76
80
 
77
81
  if audited_options[:comment_required]
78
82
  validate :presence_of_audit_comment
@@ -84,6 +88,7 @@ module Audited
84
88
 
85
89
  after_create :audit_create if audited_options[:on].include?(:create)
86
90
  before_update :audit_update if audited_options[:on].include?(:update)
91
+ after_touch :audit_touch if audited_options[:on].include?(:touch) && ::ActiveRecord::VERSION::MAJOR >= 6
87
92
  before_destroy :audit_destroy if audited_options[:on].include?(:destroy)
88
93
 
89
94
  # Define and set after_audit and around_audit callbacks. This might be useful if you want
@@ -99,6 +104,18 @@ module Audited
99
104
  def has_associated_audits
100
105
  has_many :associated_audits, as: :associated, class_name: Audited.audit_class.name
101
106
  end
107
+
108
+ def update_audited_options(new_options)
109
+ previous_audit_options = self.audited_options
110
+ set_audited_options(new_options)
111
+ self.reset_audited_columns
112
+ end
113
+
114
+ def set_audited_options(options)
115
+ self.audited_options = options
116
+ normalize_audited_options
117
+ self.audit_associated_with = audited_options[:associated_with]
118
+ end
102
119
  end
103
120
 
104
121
  module AuditedInstanceMethods
@@ -172,14 +189,15 @@ module Audited
172
189
  # List of attributes that are audited.
173
190
  def audited_attributes
174
191
  audited_attributes = attributes.except(*self.class.non_audited_columns)
192
+ audited_attributes = redact_values(audited_attributes)
193
+ audited_attributes = filter_encrypted_attrs(audited_attributes)
175
194
  normalize_enum_changes(audited_attributes)
176
195
  end
177
196
 
178
197
  # Returns a list combined of record audits and associated audits.
179
198
  def own_and_associated_audits
180
- Audited.audit_class.unscoped
181
- .where("(auditable_type = :type AND auditable_id = :id) OR (associated_type = :type AND associated_id = :id)",
182
- type: self.class.base_class.name, id: id)
199
+ Audited.audit_class.unscoped.where(auditable: self)
200
+ .or(Audited.audit_class.unscoped.where(associated: self))
183
201
  .order(created_at: :desc)
184
202
  end
185
203
 
@@ -190,8 +208,13 @@ module Audited
190
208
  combine_target.comment = "#{combine_target.comment}\nThis audit is the result of multiple audits being combined."
191
209
 
192
210
  transaction do
193
- combine_target.save!
194
- audits_to_combine.unscope(:limit).where("version < ?", combine_target.version).delete_all
211
+ begin
212
+ combine_target.save!
213
+ audits_to_combine.unscope(:limit).where("version < ?", combine_target.version).delete_all
214
+ rescue ActiveRecord::Deadlocked
215
+ # Ignore Deadlocks, if the same record is getting its old audits combined more than once at the same time then
216
+ # both combining operations will be the same. Ignoring this error allows one of the combines to go through successfully.
217
+ end
195
218
  end
196
219
  end
197
220
 
@@ -224,8 +247,17 @@ module Audited
224
247
 
225
248
  private
226
249
 
227
- def audited_changes
228
- all_changes = respond_to?(:changes_to_save) ? changes_to_save : changes
250
+ def audited_changes(for_touch: false, exclude_readonly_attrs: false)
251
+ all_changes = if for_touch
252
+ previous_changes
253
+ elsif respond_to?(:changes_to_save)
254
+ changes_to_save
255
+ else
256
+ changes
257
+ end
258
+
259
+ all_changes = all_changes.except(*self.class.readonly_attributes.to_a) if exclude_readonly_attrs
260
+
229
261
  filtered_changes = \
230
262
  if audited_options[:only].present?
231
263
  all_changes.slice(*self.class.audited_columns)
@@ -233,8 +265,17 @@ module Audited
233
265
  all_changes.except(*self.class.non_audited_columns)
234
266
  end
235
267
 
236
- filtered_changes = redact_values(filtered_changes)
237
268
  filtered_changes = normalize_enum_changes(filtered_changes)
269
+
270
+ if for_touch && (last_audit = audits.last&.audited_changes)
271
+ filtered_changes.reject! do |k, v|
272
+ last_audit[k].to_json == v.to_json ||
273
+ last_audit[k].to_json == v[1].to_json
274
+ end
275
+ end
276
+
277
+ filtered_changes = redact_values(filtered_changes)
278
+ filtered_changes = filter_encrypted_attrs(filtered_changes)
238
279
  filtered_changes.to_hash
239
280
  end
240
281
 
@@ -257,19 +298,36 @@ module Audited
257
298
  end
258
299
 
259
300
  def redact_values(filtered_changes)
260
- [audited_options[:redacted]].flatten.compact.each do |option|
261
- changes = filtered_changes[option.to_s]
262
- new_value = audited_options[:redaction_value] || REDACTED
263
- values = if changes.is_a? Array
264
- changes.map { new_value }
265
- else
266
- new_value
267
- end
268
- hash = {option.to_s => values}
269
- filtered_changes.merge!(hash)
301
+ filter_attr_values(
302
+ audited_changes: filtered_changes,
303
+ attrs: Array(audited_options[:redacted]).map(&:to_s),
304
+ placeholder: audited_options[:redaction_value] || REDACTED
305
+ )
306
+ end
307
+
308
+ def filter_encrypted_attrs(filtered_changes)
309
+ filter_attr_values(
310
+ audited_changes: filtered_changes,
311
+ attrs: respond_to?(:encrypted_attributes) ? Array(encrypted_attributes).map(&:to_s) : []
312
+ )
313
+ end
314
+
315
+ # Replace values for given attrs to a placeholder and return modified hash
316
+ #
317
+ # @param audited_changes [Hash] Hash of changes to be saved to audited version record
318
+ # @param attrs [Array<String>] Array of attrs, values of which will be replaced to placeholder value
319
+ # @param placeholder [String] Placeholder to replace original attr values
320
+ def filter_attr_values(audited_changes: {}, attrs: [], placeholder: "[FILTERED]")
321
+ attrs.each do |attr|
322
+ next unless audited_changes.key?(attr)
323
+
324
+ changes = audited_changes[attr]
325
+ values = changes.is_a?(Array) ? changes.map { placeholder } : placeholder
326
+
327
+ audited_changes[attr] = values
270
328
  end
271
329
 
272
- filtered_changes
330
+ audited_changes
273
331
  end
274
332
 
275
333
  def rails_below?(rails_version)
@@ -290,28 +348,36 @@ module Audited
290
348
 
291
349
  def audit_create
292
350
  write_audit(action: "create", audited_changes: audited_attributes,
293
- comment: audit_comment)
351
+ comment: audit_comment)
294
352
  end
295
353
 
296
354
  def audit_update
297
- unless (changes = audited_changes).empty? && (audit_comment.blank? || audited_options[:update_with_comment_only] == false)
355
+ unless (changes = audited_changes(exclude_readonly_attrs: true)).empty? && (audit_comment.blank? || audited_options[:update_with_comment_only] == false)
298
356
  write_audit(action: "update", audited_changes: changes,
299
- comment: audit_comment)
357
+ comment: audit_comment)
358
+ end
359
+ end
360
+
361
+ def audit_touch
362
+ unless (changes = audited_changes(for_touch: true, exclude_readonly_attrs: true)).empty?
363
+ write_audit(action: "update", audited_changes: changes,
364
+ comment: audit_comment)
300
365
  end
301
366
  end
302
367
 
303
368
  def audit_destroy
304
369
  unless new_record?
305
370
  write_audit(action: "destroy", audited_changes: audited_attributes,
306
- comment: audit_comment)
371
+ comment: audit_comment)
307
372
  end
308
373
  end
309
374
 
310
375
  def write_audit(attrs)
311
- attrs[:associated] = send(audit_associated_with) unless audit_associated_with.nil?
312
376
  self.audit_comment = nil
313
377
 
314
378
  if auditing_enabled
379
+ attrs[:associated] = send(audit_associated_with) unless audit_associated_with.nil?
380
+
315
381
  run_callbacks(:audit) {
316
382
  audit = audits.create(attrs)
317
383
  combine_audits_if_needed if attrs[:action] != "create"
@@ -334,13 +400,25 @@ module Audited
334
400
  end
335
401
 
336
402
  def combine_audits_if_needed
337
- max_audits = audited_options[:max_audits]
403
+ max_audits = evaluate_max_audits
404
+
338
405
  if max_audits && (extra_count = audits.count - max_audits) > 0
339
406
  audits_to_combine = audits.limit(extra_count + 1)
340
407
  combine_audits(audits_to_combine)
341
408
  end
342
409
  end
343
410
 
411
+ def evaluate_max_audits
412
+ max_audits = case (option = audited_options[:max_audits])
413
+ when Proc then option.call
414
+ when Symbol then send(option)
415
+ else
416
+ option
417
+ end
418
+
419
+ Integer(max_audits).abs if max_audits
420
+ end
421
+
344
422
  def require_comment
345
423
  if auditing_enabled && audit_comment.blank?
346
424
  errors.add(:audit_comment, :blank)
@@ -396,7 +474,7 @@ module Audited
396
474
  # end
397
475
  #
398
476
  def without_auditing
399
- auditing_was_enabled = auditing_enabled
477
+ auditing_was_enabled = class_auditing_enabled
400
478
  disable_auditing
401
479
  yield
402
480
  ensure
@@ -410,7 +488,7 @@ module Audited
410
488
  # end
411
489
  #
412
490
  def with_auditing
413
- auditing_was_enabled = auditing_enabled
491
+ auditing_was_enabled = class_auditing_enabled
414
492
  enable_auditing
415
493
  yield
416
494
  ensure
@@ -434,7 +512,7 @@ module Audited
434
512
  end
435
513
 
436
514
  def auditing_enabled
437
- Audited.store.fetch("#{table_name}_auditing_enabled", true) && Audited.auditing_enabled
515
+ class_auditing_enabled && Audited.auditing_enabled
438
516
  end
439
517
 
440
518
  def auditing_enabled=(val)
@@ -449,11 +527,10 @@ module Audited
449
527
 
450
528
  def normalize_audited_options
451
529
  audited_options[:on] = Array.wrap(audited_options[:on])
452
- audited_options[:on] = [:create, :update, :destroy] if audited_options[:on].empty?
530
+ audited_options[:on] = ([:create, :update, :touch, :destroy] - Audited.ignored_default_callbacks) if audited_options[:on].empty?
453
531
  audited_options[:only] = Array.wrap(audited_options[:only]).map(&:to_s)
454
532
  audited_options[:except] = Array.wrap(audited_options[:except]).map(&:to_s)
455
- max_audits = audited_options[:max_audits] || Audited.max_audits
456
- audited_options[:max_audits] = Integer(max_audits).abs if max_audits
533
+ audited_options[:max_audits] ||= Audited.max_audits
457
534
  end
458
535
 
459
536
  def calculate_non_audited_columns
@@ -465,6 +542,15 @@ module Audited
465
542
  default_ignored_attributes
466
543
  end
467
544
  end
545
+
546
+ def class_auditing_enabled
547
+ Audited.store.fetch("#{table_name}_auditing_enabled", true)
548
+ end
549
+
550
+ def reset_audited_columns
551
+ @audited_columns = nil
552
+ @non_audited_columns = nil
553
+ end
468
554
  end
469
555
  end
470
556
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Audited
4
- VERSION = "5.0.0"
4
+ VERSION = "5.8.0"
5
5
  end
data/lib/audited.rb CHANGED
@@ -3,27 +3,35 @@
3
3
  require "active_record"
4
4
 
5
5
  module Audited
6
+ # Wrapper around ActiveSupport::CurrentAttributes
7
+ class RequestStore < ActiveSupport::CurrentAttributes
8
+ attribute :audited_store
9
+ end
10
+
6
11
  class << self
7
12
  attr_accessor \
8
13
  :auditing_enabled,
9
14
  :current_user_method,
10
15
  :ignored_attributes,
16
+ :ignored_default_callbacks,
11
17
  :max_audits,
12
18
  :store_synthesized_enums
13
19
  attr_writer :audit_class
14
20
 
15
21
  def audit_class
16
- @audit_class ||= Audit
22
+ # The audit_class is set as String in the initializer. It can not be constantized during initialization and must
23
+ # be constantized at runtime. See https://github.com/collectiveidea/audited/issues/608
24
+ @audit_class = @audit_class.safe_constantize if @audit_class.is_a?(String)
25
+ @audit_class ||= Audited::Audit
17
26
  end
18
27
 
19
- def store
20
- current_store_value = Thread.current.thread_variable_get(:audited_store)
28
+ # remove audit_model in next major version it was only shortly present in 5.1.0
29
+ alias_method :audit_model, :audit_class
30
+ deprecate audit_model: "use Audited.audit_class instead of Audited.audit_model. This method will be removed.",
31
+ deprecator: ActiveSupport::Deprecation.new('6.0.0', 'Audited')
21
32
 
22
- if current_store_value.nil?
23
- Thread.current.thread_variable_set(:audited_store, {})
24
- else
25
- current_store_value
26
- end
33
+ def store
34
+ RequestStore.audited_store ||= {}
27
35
  end
28
36
 
29
37
  def config
@@ -32,6 +40,7 @@ module Audited
32
40
  end
33
41
 
34
42
  @ignored_attributes = %w[lock_version created_at updated_at created_on updated_on]
43
+ @ignored_default_callbacks = []
35
44
 
36
45
  @current_user_method = :current_user
37
46
  @auditing_enabled = true
@@ -39,11 +48,11 @@ module Audited
39
48
  end
40
49
 
41
50
  require "audited/auditor"
42
- require "audited/audit"
43
51
 
44
52
  ActiveSupport.on_load :active_record do
53
+ require "audited/audit"
45
54
  include Audited::Auditor
46
55
  end
47
56
 
48
57
  require "audited/sweeper"
49
- require "audited/railtie"
58
+ require "audited/railtie" if Audited.const_defined?(:Rails)
@@ -4,14 +4,22 @@ module Audited
4
4
  module Generators
5
5
  module Migration
6
6
  # Implement the required interface for Rails::Generators::Migration.
7
- def next_migration_number(dirname) #:nodoc:
7
+ def next_migration_number(dirname) # :nodoc:
8
8
  next_migration_number = current_migration_number(dirname) + 1
9
- if ::ActiveRecord::Base.timestamped_migrations
9
+ if timestamped_migrations?
10
10
  [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
11
11
  else
12
12
  "%.3d" % next_migration_number
13
13
  end
14
14
  end
15
+
16
+ private
17
+
18
+ def timestamped_migrations?
19
+ (Rails.gem_version >= Gem::Version.new("7.0")) ?
20
+ ::ActiveRecord.timestamped_migrations :
21
+ ::ActiveRecord::Base.timestamped_migrations
22
+ end
15
23
  end
16
24
  end
17
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audited
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -10,10 +10,10 @@ authors:
10
10
  - Brian Ryckbost
11
11
  - Steve Richert
12
12
  - Ryan Glover
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-06-10 00:00:00.000000000 Z
16
+ date: 2024-11-08 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activerecord
@@ -21,20 +21,40 @@ dependencies:
21
21
  requirements:
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: '5.0'
24
+ version: '5.2'
25
25
  - - "<"
26
26
  - !ruby/object:Gem::Version
27
- version: '6.2'
27
+ version: '8.2'
28
28
  type: :runtime
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '5.0'
34
+ version: '5.2'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '6.2'
37
+ version: '8.2'
38
+ - !ruby/object:Gem::Dependency
39
+ name: activesupport
40
+ requirement: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '5.2'
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '8.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.2'
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: '8.2'
38
58
  - !ruby/object:Gem::Dependency
39
59
  name: appraisal
40
60
  requirement: !ruby/object:Gem::Requirement
@@ -55,20 +75,20 @@ dependencies:
55
75
  requirements:
56
76
  - - ">="
57
77
  - !ruby/object:Gem::Version
58
- version: '5.0'
78
+ version: '5.2'
59
79
  - - "<"
60
80
  - !ruby/object:Gem::Version
61
- version: '6.2'
81
+ version: '8.2'
62
82
  type: :development
63
83
  prerelease: false
64
84
  version_requirements: !ruby/object:Gem::Requirement
65
85
  requirements:
66
86
  - - ">="
67
87
  - !ruby/object:Gem::Version
68
- version: '5.0'
88
+ version: '5.2'
69
89
  - - "<"
70
90
  - !ruby/object:Gem::Version
71
- version: '6.2'
91
+ version: '8.2'
72
92
  - !ruby/object:Gem::Dependency
73
93
  name: rspec-rails
74
94
  requirement: !ruby/object:Gem::Requirement
@@ -115,16 +135,16 @@ dependencies:
115
135
  name: sqlite3
116
136
  requirement: !ruby/object:Gem::Requirement
117
137
  requirements:
118
- - - "~>"
138
+ - - ">="
119
139
  - !ruby/object:Gem::Version
120
- version: '1.3'
140
+ version: 1.3.6
121
141
  type: :development
122
142
  prerelease: false
123
143
  version_requirements: !ruby/object:Gem::Requirement
124
144
  requirements:
125
- - - "~>"
145
+ - - ">="
126
146
  - !ruby/object:Gem::Version
127
- version: '1.3'
147
+ version: 1.3.6
128
148
  - !ruby/object:Gem::Dependency
129
149
  name: mysql2
130
150
  requirement: !ruby/object:Gem::Requirement
@@ -165,21 +185,13 @@ executables: []
165
185
  extensions: []
166
186
  extra_rdoc_files: []
167
187
  files:
168
- - ".gitignore"
169
- - ".standard.yml"
170
- - ".travis.yml"
171
- - ".yardopts"
172
188
  - Appraisals
173
189
  - CHANGELOG.md
174
190
  - Gemfile
175
191
  - LICENSE
176
192
  - README.md
177
193
  - Rakefile
178
- - gemfiles/rails50.gemfile
179
- - gemfiles/rails51.gemfile
180
- - gemfiles/rails52.gemfile
181
- - gemfiles/rails60.gemfile
182
- - gemfiles/rails61.gemfile
194
+ - audited.gemspec
183
195
  - lib/audited-rspec.rb
184
196
  - lib/audited.rb
185
197
  - lib/audited/audit.rb
@@ -202,40 +214,11 @@ files:
202
214
  - lib/generators/audited/templates/rename_parent_to_association.rb
203
215
  - lib/generators/audited/templates/revert_polymorphic_indexes_order.rb
204
216
  - lib/generators/audited/upgrade_generator.rb
205
- - spec/audited/audit_spec.rb
206
- - spec/audited/auditor_spec.rb
207
- - spec/audited/rspec_matchers_spec.rb
208
- - spec/audited/sweeper_spec.rb
209
- - spec/audited_spec.rb
210
- - spec/audited_spec_helpers.rb
211
- - spec/rails_app/app/assets/config/manifest.js
212
- - spec/rails_app/config/application.rb
213
- - spec/rails_app/config/database.yml
214
- - spec/rails_app/config/environment.rb
215
- - spec/rails_app/config/environments/test.rb
216
- - spec/rails_app/config/initializers/backtrace_silencers.rb
217
- - spec/rails_app/config/initializers/inflections.rb
218
- - spec/rails_app/config/initializers/secret_token.rb
219
- - spec/rails_app/config/routes.rb
220
- - spec/spec_helper.rb
221
- - spec/support/active_record/models.rb
222
- - spec/support/active_record/postgres/1_change_audited_changes_type_to_json.rb
223
- - spec/support/active_record/postgres/2_change_audited_changes_type_to_jsonb.rb
224
- - spec/support/active_record/schema.rb
225
- - test/db/version_1.rb
226
- - test/db/version_2.rb
227
- - test/db/version_3.rb
228
- - test/db/version_4.rb
229
- - test/db/version_5.rb
230
- - test/db/version_6.rb
231
- - test/install_generator_test.rb
232
- - test/test_helper.rb
233
- - test/upgrade_generator_test.rb
234
217
  homepage: https://github.com/collectiveidea/audited
235
218
  licenses:
236
219
  - MIT
237
220
  metadata: {}
238
- post_install_message:
221
+ post_install_message:
239
222
  rdoc_options: []
240
223
  require_paths:
241
224
  - lib
@@ -250,8 +233,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
233
  - !ruby/object:Gem::Version
251
234
  version: '0'
252
235
  requirements: []
253
- rubygems_version: 3.1.6
254
- signing_key:
236
+ rubygems_version: 3.5.22
237
+ signing_key:
255
238
  specification_version: 4
256
239
  summary: Log all changes to your models
257
240
  test_files: []
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.iml
2
- *.ipr
3
- *.iws
4
- *.log
5
- *.swp
6
- .bundle
7
- .rakeTasks
8
- .ruby-gemset
9
- .ruby-version
10
- .rvmrc
11
- .yardoc
12
- doc/
13
- Gemfile.lock
14
- gemfiles/*.lock
15
- pkg
16
- tmp/*
17
- audited_test.sqlite3.db
data/.standard.yml DELETED
@@ -1,5 +0,0 @@
1
- ruby_version: 2.3
2
- ignore:
3
- - lib/generators/audited/templates/**/*
4
- - vendor/bundle/**/*
5
- - gemfiles/vendor/bundle/**/*
data/.travis.yml DELETED
@@ -1,67 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.3.8
5
- - 2.4.10
6
- - 2.5.9
7
- - 2.6.7
8
- - 2.7.3
9
- - 3.0.1
10
- - ruby-head
11
- env:
12
- - DB=SQLITE
13
- - DB=POSTGRES
14
- - DB=MYSQL
15
- addons:
16
- postgresql: "9.4"
17
- services:
18
- - mysql
19
- before_install:
20
- # https://github.com/travis-ci/travis-ci/issues/8978
21
- - "travis_retry gem update --system"
22
- gemfile:
23
- - gemfiles/rails50.gemfile
24
- - gemfiles/rails51.gemfile
25
- - gemfiles/rails52.gemfile
26
- - gemfiles/rails60.gemfile
27
- - gemfiles/rails61.gemfile
28
- matrix:
29
- include:
30
- - rvm: 2.6.7
31
- script: bundle exec standardrb
32
- env: DB=standard # make travis build display nicer
33
- exclude:
34
- - rvm: 2.3.8
35
- gemfile: gemfiles/rails61.gemfile
36
- - rvm: 2.4.10
37
- gemfile: gemfiles/rails61.gemfile
38
- - rvm: 2.3.8
39
- gemfile: gemfiles/rails60.gemfile
40
- - rvm: 2.4.10
41
- gemfile: gemfiles/rails60.gemfile
42
- - rvm: 2.6.7
43
- gemfile: gemfiles/rails42.gemfile
44
- - rvm: 2.7.3
45
- gemfile: gemfiles/rails42.gemfile
46
- - rvm: 3.0.1
47
- gemfile: gemfiles/rails42.gemfile
48
- - rvm: 3.0.1
49
- gemfile: gemfiles/rails50.gemfile
50
- - rvm: 3.0.1
51
- gemfile: gemfiles/rails51.gemfile
52
- - rvm: 3.0.1
53
- gemfile: gemfiles/rails52.gemfile
54
- - rvm: ruby-head
55
- gemfile: gemfiles/rails42.gemfile
56
- allow_failures:
57
- - rvm: ruby-head
58
- fast_finish: true
59
- branches:
60
- only:
61
- - master
62
- - /.*-stable$/
63
- notifications:
64
- webhooks:
65
- urls:
66
- - https://buildlight.collectiveidea.com/
67
- on_start: always
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --no-private
2
- --title acts_as_audited
3
- --exclude lib/generators