paper_trail 15.1.0 → 15.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/paper_trail/install/templates/create_versions.rb.erb +7 -4
- data/lib/paper_trail/compatibility.rb +1 -1
- data/lib/paper_trail/frameworks/rails/railtie.rb +5 -1
- data/lib/paper_trail/model_config.rb +2 -2
- data/lib/paper_trail/version_number.rb +1 -1
- data/lib/paper_trail.rb +4 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0972b7805c1dea218a2eb15d46e68c76650fe4d8752e00a64080c38360544ede'
|
4
|
+
data.tar.gz: f242c006d46c1af35e67dcbf667458356372fba3d90238d56d29989f257f5f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
14
|
-
t
|
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.
|
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
|
-
|
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
|
-
|
195
|
+
PaperTrail.deprecator.warn(
|
196
196
|
format(
|
197
197
|
DPR_PASSING_ASSOC_NAME_DIRECTLY_TO_VERSIONS_OPTION,
|
198
198
|
versions_name: options[:versions].inspect
|
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.
|
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:
|
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.
|
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.
|
56
|
+
version: '2.5'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: byebug
|
59
59
|
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:
|