paper_trail 5.2.1 → 5.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 094660b594e3a7fdd137f0b9a5e586146390223d
4
- data.tar.gz: 9b0150f21b8ce6f20b2f9aefb558d03253e0e233
3
+ metadata.gz: 40131e454009216354dd82f76bfab5ecbc465efb
4
+ data.tar.gz: b1cbd97963f0ef014c90b2462eceaac5e6df2e77
5
5
  SHA512:
6
- metadata.gz: f382487c3077476976b91107d3fa4014859d028e45c5ae6d2b7f0dd5d9003ac24d1619029992f2fa4b2ffa5683be19f0142fd1d1f027f1f97182829775e00e14
7
- data.tar.gz: 7102dab0875334e462c7ff46b7836de36028fb4ea7e1fabcf55dfcd0ec8545c56fa941ef6833f530353bf32f6aa8d42b86ee9dc64bb731cedbb0f997431a6a43
6
+ metadata.gz: 42138b9e11f51e210cc11af893b77f1834727c4280dd522ef28465856f3af0072d7065c3a906ccdfcb28ee50d80eefa7535033a6c65a612287ea0d89cd7faf58
7
+ data.tar.gz: 8a54e81675b6954778ebd715f596886991a47aba63fb0cf3a549be9410947e181a4084b323c64d156c8587306f2c2d6aec557479f3466dada0c34feefc400177
@@ -19,6 +19,24 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
19
19
 
20
20
  ### Fixed
21
21
 
22
+ ## 5.2.2 (2016-09-08)
23
+
24
+ ### Breaking Changes
25
+
26
+ - None
27
+
28
+ ### Deprecated
29
+
30
+ - [#863](https://github.com/airblade/paper_trail/pull/863)
31
+ PaperTrail.timestamp_field= deprecated without replacement.
32
+ See [#861](https://github.com/airblade/paper_trail/pull/861) for discussion.
33
+
34
+ ### Added
35
+
36
+ - None
37
+
38
+ ### Fixed
39
+
22
40
  ## 5.2.1 (2016-09-02)
23
41
 
24
42
  ### Breaking Changes
@@ -129,8 +147,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
129
147
  - [#556](https://github.com/airblade/paper_trail/pull/556) /
130
148
  [#301](https://github.com/airblade/paper_trail/issues/301) -
131
149
  If you are tracking who is responsible for changes with `whodunnit`, be aware
132
- that PaperTrail no longer adds the `set_paper_trail_whodunnit` before_filter
133
- for you. Please add this before_filter to your ApplicationController to
150
+ that PaperTrail no longer adds the `set_paper_trail_whodunnit` before_action
151
+ for you. Please add this before_action to your ApplicationController to
134
152
  continue recording whodunnit. See the readme for an example.
135
153
  - [#683](https://github.com/airblade/paper_trail/pull/683) /
136
154
  [#682](https://github.com/airblade/paper_trail/issues/682) -
data/README.md CHANGED
@@ -11,7 +11,7 @@ has been destroyed.
11
11
  | Version | Documentation |
12
12
  | -------------- | ------------- |
13
13
  | Unreleased | https://github.com/airblade/paper_trail/blob/master/README.md |
14
- | 5.2.1 | https://github.com/airblade/paper_trail/blob/v5.2.1/README.md |
14
+ | 5.2.2 | https://github.com/airblade/paper_trail/blob/v5.2.2/README.md |
15
15
  | 4.2.0 | https://github.com/airblade/paper_trail/blob/v4.2.0/README.md |
16
16
  | 3.0.9 | https://github.com/airblade/paper_trail/blob/v3.0.9/README.md |
17
17
  | 2.7.2 | https://github.com/airblade/paper_trail/blob/v2.7.2/README.md |
@@ -57,7 +57,8 @@ has been destroyed.
57
57
 
58
58
  | paper_trail | branch | tags | ruby | activerecord |
59
59
  | -------------- | ---------- | ------ | -------- | ------------ |
60
- | 5 | master | v5.x | >= 1.9.3 | >= 3.0, < 6 |
60
+ | 6 (unreleased) | master | | >= 1.9.3 | >= 3.0, < 6 |
61
+ | 5 | 5-stable | v5.x | >= 1.9.3 | >= 3.0, < 6 |
61
62
  | 4 | 4-stable | v4.x | >= 1.8.7 | >= 3.0, < 6 |
62
63
  | 3 | 3.0-stable | v3.x | >= 1.8.7 | >= 3.0, < 5 |
63
64
  | 2 | 2.7-stable | v2.x | >= 1.8.7 | >= 3.0, < 4 |
@@ -94,7 +95,7 @@ by adding a controller callback.
94
95
 
95
96
  ```ruby
96
97
  class ApplicationController
97
- before_filter :set_paper_trail_whodunnit
98
+ before_action :set_paper_trail_whodunnit
98
99
  end
99
100
  ```
100
101
 
@@ -691,12 +692,12 @@ widget.versions.last.whodunnit # Andy Stewart
691
692
  ```
692
693
 
693
694
  If your controller has a `current_user` method, PaperTrail provides a
694
- `before_filter` that will assign `current_user.id` to `PaperTrail.whodunnit`.
695
- You can add this `before_filter` to your `ApplicationController`.
695
+ `before_action` that will assign `current_user.id` to `PaperTrail.whodunnit`.
696
+ You can add this `before_action` to your `ApplicationController`.
696
697
 
697
698
  ```ruby
698
699
  class ApplicationController
699
- before_filter :set_paper_trail_whodunnit
700
+ before_action :set_paper_trail_whodunnit
700
701
  end
701
702
  ```
702
703
 
@@ -3,12 +3,12 @@
3
3
  After upgrading to PaperTrail 5, you see this warning:
4
4
 
5
5
  > user_for_paper_trail is present, but whodunnit has not been set. PaperTrail no
6
- > longer adds the set_paper_trail_whodunnit before_filter for you. Please add this
7
- > before_filter to your ApplicationController to continue recording whodunnit.
6
+ > longer adds the set_paper_trail_whodunnit before_action for you. Please add this
7
+ > before_action to your ApplicationController to continue recording whodunnit.
8
8
 
9
9
  ## You want to track whodunnit
10
10
 
11
- Add the set_paper_trail_whodunnit before_filter to your ApplicationController.
11
+ Add the set_paper_trail_whodunnit before_action to your ApplicationController.
12
12
  See the PaperTrail readme for an example (https://git.io/vrsbt).
13
13
 
14
14
  ## You don't want to track whodunnit
@@ -72,12 +72,19 @@ module PaperTrail
72
72
 
73
73
  # Set the field which records when a version was created.
74
74
  # @api public
75
+ # @deprecated
75
76
  def timestamp_field=(field_name)
77
+ ::ActiveSupport::Deprecation.warn(
78
+ "PaperTrail.timestamp_field= is deprecated without replacement." \
79
+ "See https://github.com/airblade/paper_trail/pull/861 for discussion",
80
+ caller(1)
81
+ )
76
82
  PaperTrail.config.timestamp_field = field_name
77
83
  end
78
84
 
79
85
  # Returns the field which records when a version was created.
80
86
  # @api public
87
+ # @deprecated
81
88
  def timestamp_field
82
89
  PaperTrail.config.timestamp_field
83
90
  end
@@ -6,7 +6,8 @@ module PaperTrail
6
6
  # configuration can be found in `paper_trail.rb`, others in `controller.rb`.
7
7
  class Config
8
8
  include Singleton
9
- attr_accessor :timestamp_field, :serializer, :version_limit
9
+ attr_accessor :serializer, :version_limit
10
+ attr_reader :timestamp_field # deprecated
10
11
  attr_writer :track_associations
11
12
 
12
13
  def initialize
@@ -34,6 +35,18 @@ module PaperTrail
34
35
  )
35
36
  end
36
37
 
38
+ # Set the field which records when a version was created.
39
+ # @api public
40
+ # @deprecated
41
+ def timestamp_field=(field_name)
42
+ ::ActiveSupport::Deprecation.warn(
43
+ "PaperTrail.config.timestamp_field= is deprecated without replacement." \
44
+ "See https://github.com/airblade/paper_trail/pull/861 for discussion",
45
+ caller(1)
46
+ )
47
+ @timestamp_field = field_name
48
+ end
49
+
37
50
  # Previously, we checked `PaperTrail::VersionAssociation.table_exists?`
38
51
  # here, but that proved to be problematic in situations when the database
39
52
  # connection had not been established, or when the database does not exist
@@ -3,7 +3,7 @@ module PaperTrail
3
3
  module VERSION
4
4
  MAJOR = 5
5
5
  MINOR = 2
6
- TINY = 1
6
+ TINY = 2
7
7
  PRE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.required_ruby_version = ">= 1.9.3"
22
22
 
23
23
  s.add_dependency "activerecord", [">= 3.0", "< 6.0"]
24
- s.add_dependency "activesupport", [">= 3.0", "< 6.0"]
25
24
  s.add_dependency "request_store", "~> 1.1"
26
25
 
27
26
  s.add_development_dependency "appraisal", "~> 2.1"
@@ -32,7 +32,6 @@ class SetUpTestTables < ActiveRecord::Migration
32
32
  t.time :a_time
33
33
  t.date :a_date
34
34
  t.boolean :a_boolean
35
- t.string :sacrificial_column
36
35
  t.string :type
37
36
  t.timestamps null: true
38
37
  end
@@ -250,12 +250,11 @@ ActiveRecord::Schema.define(version: 20110208155312) do
250
250
  t.text "a_text"
251
251
  t.integer "an_integer"
252
252
  t.float "a_float"
253
- t.decimal "a_decimal", precision: 6, scale: 4
253
+ t.decimal "a_decimal", precision: 6, scale: 4
254
254
  t.datetime "a_datetime"
255
255
  t.time "a_time"
256
256
  t.date "a_date"
257
257
  t.boolean "a_boolean"
258
- t.string "sacrificial_column"
259
258
  t.string "type"
260
259
  t.datetime "created_at"
261
260
  t.datetime "updated_at"
@@ -95,7 +95,6 @@ end
95
95
  def change_schema
96
96
  ActiveRecord::Migration.verbose = false
97
97
  ActiveRecord::Schema.define do
98
- remove_column :widgets, :sacrificial_column
99
98
  add_column :versions, :custom_created_at, :datetime
100
99
  end
101
100
  ActiveRecord::Migration.verbose = true
@@ -121,7 +120,6 @@ end
121
120
  def restore_schema
122
121
  ActiveRecord::Migration.verbose = false
123
122
  ActiveRecord::Schema.define do
124
- add_column :widgets, :sacrificial_column, :string
125
123
  remove_column :versions, :custom_created_at
126
124
  end
127
125
  ActiveRecord::Migration.verbose = true
@@ -520,7 +520,6 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
520
520
  change_schema
521
521
  Widget.connection.schema_cache.clear!
522
522
  Widget.reset_column_information
523
- assert_raise(NoMethodError) { Widget.new.sacrificial_column }
524
523
  @last = @widget.versions.last
525
524
  end
526
525
 
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: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-02 00:00:00.000000000 Z
12
+ date: 2016-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -31,26 +31,6 @@ dependencies:
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '6.0'
34
- - !ruby/object:Gem::Dependency
35
- name: activesupport
36
- requirement: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
41
- - - "<"
42
- - !ruby/object:Gem::Version
43
- version: '6.0'
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: !ruby/object:Gem::Requirement
47
- requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: '3.0'
51
- - - "<"
52
- - !ruby/object:Gem::Version
53
- version: '6.0'
54
34
  - !ruby/object:Gem::Dependency
55
35
  name: request_store
56
36
  requirement: !ruby/object:Gem::Requirement