paper_trail 15.0.0 → 15.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a343a4be31774100a8713280696dcfad46cd119b04de6884de7b6a1b34acd13
4
- data.tar.gz: 120dfe293f08004ee33bb09a0db23d3004ea2dadfaff56e8992283564458df28
3
+ metadata.gz: '0972b7805c1dea218a2eb15d46e68c76650fe4d8752e00a64080c38360544ede'
4
+ data.tar.gz: f242c006d46c1af35e67dcbf667458356372fba3d90238d56d29989f257f5f34
5
5
  SHA512:
6
- metadata.gz: 8401d4f39db71320590dab474b8782a4f52843394869d12aa3cb5270d25170df8435af7a1c97cdcb3b1acbd8841eacdfd0c905c681b6e1173b2e6c0a69e37af9
7
- data.tar.gz: 0ec02b4a9ab72e45741ba79c8c4b09c524a02dc01de35b7763322eea5612112ae0be36e4a6dcf50c297b8bf8f0c5b96d78719d2f7839352b8d57c383d6fd250a
6
+ metadata.gz: 91e251f425f7389ffdd39e7793f6665f53dec8f1f967f0befbd00df0fd2aef423f7c074520b4f5f4410c3bfbca1f1c0beb2afe61c6d19825e1818209d36e8c45
7
+ data.tar.gz: f2eeac74231a4b51fd2e0b699c2591e0b3de1aad6f8d96bd8863375b37c78d96f6ca6161d7e552a856ee92821380d3f457f111322a686254a964117c908bf5b0
@@ -10,11 +10,9 @@ class CreateVersions < ActiveRecord::Migration<%= migration_version %>
10
10
 
11
11
  def change
12
12
  create_table :versions<%= versions_table_options %><%= version_table_primary_key_type %> do |t|
13
- t.string :item_type<%= item_type_options %>
14
- t.<%= item_id_type_options %> :item_id, null: false
15
- t.string :event, null: false
13
+ # Consider using bigint type for performance if you are going to store only numeric ids.
14
+ # t.bigint :whodunnit
16
15
  t.string :whodunnit
17
- t.text :object, limit: TEXT_BYTES
18
16
 
19
17
  # Known issue in MySQL: fractional second precision
20
18
  # -------------------------------------------------
@@ -32,6 +30,11 @@ class CreateVersions < ActiveRecord::Migration<%= migration_version %>
32
30
  # MySQL users should use the following line for `created_at`
33
31
  # t.datetime :created_at, limit: 6
34
32
  t.datetime :created_at
33
+
34
+ t.<%= item_id_type_options %> :item_id, null: false
35
+ t.string :item_type<%= item_type_options %>
36
+ t.string :event, null: false
37
+ t.text :object, limit: TEXT_BYTES
35
38
  end
36
39
  add_index :versions, %i[item_type item_id]
37
40
  end
@@ -18,7 +18,7 @@ module PaperTrail
18
18
  # versions.
19
19
  module Compatibility
20
20
  ACTIVERECORD_GTE = ">= 6.1" # enforced in gemspec
21
- ACTIVERECORD_LT = "< 7.1" # not enforced in gemspec
21
+ ACTIVERECORD_LT = "< 7.3" # not enforced in gemspec
22
22
 
23
23
  E_INCOMPATIBLE_AR = <<-EOS
24
24
  PaperTrail %s is not compatible with ActiveRecord %s. We allow PT
@@ -10,7 +10,7 @@ module PaperTrail
10
10
  # We specify `before: "load_config_initializers"` to ensure that the PT
11
11
  # initializer happens before "app initializers" (those defined in
12
12
  # the app's `config/initalizers`).
13
- initializer "paper_trail", before: "load_config_initializers" do
13
+ initializer "paper_trail", before: "load_config_initializers" do |app|
14
14
  # `on_load` is a "lazy load hook". It "declares a block that will be
15
15
  # executed when a Rails component is fully loaded". (See
16
16
  # `active_support/lazy_load_hooks.rb`)
@@ -25,6 +25,10 @@ module PaperTrail
25
25
  ActiveSupport.on_load(:active_record) do
26
26
  require "paper_trail/frameworks/active_record"
27
27
  end
28
+
29
+ if Gem::Version.new(::Rails::VERSION::STRING) >= Gem::Version.new("7.1")
30
+ app.deprecators[:paper_trail] = PaperTrail.deprecator
31
+ end
28
32
  end
29
33
  end
30
34
  end
@@ -156,7 +156,7 @@ module PaperTrail
156
156
  # @api private - `version_class_name`
157
157
  @model_class.class_attribute :version_class_name
158
158
  if options[:class_name]
159
- ::ActiveSupport::Deprecation.warn(
159
+ PaperTrail.deprecator.warn(
160
160
  format(
161
161
  DPR_CLASS_NAME_OPTION,
162
162
  class_name: options[:class_name].inspect
@@ -192,7 +192,7 @@ module PaperTrail
192
192
  def ensure_versions_option_is_hash(options)
193
193
  unless options[:versions].is_a?(Hash)
194
194
  if options[:versions]
195
- ::ActiveSupport::Deprecation.warn(
195
+ PaperTrail.deprecator.warn(
196
196
  format(
197
197
  DPR_PASSING_ASSOC_NAME_DIRECTLY_TO_VERSIONS_OPTION,
198
198
  versions_name: options[:versions].inspect
@@ -8,7 +8,7 @@ module PaperTrail
8
8
  # People are encouraged to use `PaperTrail.gem_version` instead.
9
9
  module VERSION
10
10
  MAJOR = 15
11
- MINOR = 0
11
+ MINOR = 2
12
12
  TINY = 0
13
13
 
14
14
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
data/lib/paper_trail.rb CHANGED
@@ -118,6 +118,10 @@ module PaperTrail
118
118
  def active_record_gte_7_0?
119
119
  @active_record_gte_7_0 ||= ::ActiveRecord.gem_version >= ::Gem::Version.new("7.0.0")
120
120
  end
121
+
122
+ def deprecator
123
+ @deprecator ||= ActiveSupport::Deprecation.new("16.0", "PaperTrail")
124
+ end
121
125
  end
122
126
  end
123
127
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.0
4
+ version: 15.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-07 00:00:00.000000000 Z
13
+ date: 2024-09-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -46,14 +46,14 @@ dependencies:
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 2.4.1
49
+ version: '2.5'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 2.4.1
56
+ version: '2.5'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: byebug
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -144,14 +144,14 @@ dependencies:
144
144
  requirements:
145
145
  - - "~>"
146
146
  - !ruby/object:Gem::Version
147
- version: 5.0.2
147
+ version: 6.0.3
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - "~>"
153
153
  - !ruby/object:Gem::Version
154
- version: 5.0.2
154
+ version: 6.0.3
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: rubocop
157
157
  requirement: !ruby/object:Gem::Requirement
@@ -351,7 +351,8 @@ files:
351
351
  homepage: https://github.com/paper-trail-gem/paper_trail
352
352
  licenses:
353
353
  - MIT
354
- metadata: {}
354
+ metadata:
355
+ changelog_uri: https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md
355
356
  post_install_message:
356
357
  rdoc_options: []
357
358
  require_paths: