paper_trail 4.1.0 → 4.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80cb56f3a2c0989873fe5086674a3a170c6dbaf0
4
- data.tar.gz: c88a259524d7ec2f8298360d7505ed17b23da9a8
3
+ metadata.gz: e7937d44654d4f77422ffe61d4bc2d81b7ed4026
4
+ data.tar.gz: 9ec1f8bc013795818775e58e1cd9c33e5dd36499
5
5
  SHA512:
6
- metadata.gz: 2ca33cf4ce53eb49d4ff3fbe795efd4c21f14e0b5600e4051c9d69896c5f69119b73cfa4417a340e1cf4821da4a59549d84a79d85a1975b4d4664d2d7bcef673
7
- data.tar.gz: a74706949f90071143f97f04f22a069afd0c4b7981b0436d4f947c75a713afdf273683a095ea556f56f3927e33630ab0f17e6426bf9381edb5f7b9bc1c324782
6
+ metadata.gz: e546ad5e910cc2a08aeaaf0dca6754e05f3a89fbfb022b49a078025e09a623e359a552c2e52f3126c84662fad2cd804c34db709689211852ff43e32ff40db3a1
7
+ data.tar.gz: 0ef05118041333567e076bc8407330917cc36ec5d23aec22fd6dced9367b10a466c4284eccddbb3f4d0675c4154165f24097eafe4acf0135e133c426a2b71d4b
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ pkg/*
12
12
  .bundle
13
13
  .rbenv-version
14
14
  Gemfile.lock
15
+ gemfiles/*.lock
15
16
  vendor/*
16
17
  .idea
17
18
  .rvmrc
data/.travis.yml CHANGED
@@ -27,7 +27,7 @@ before_script:
27
27
 
28
28
  gemfile:
29
29
  - Gemfile
30
- - gemfiles/3.0.gemfile
30
+ - gemfiles/ar3.gemfile
31
31
 
32
32
  matrix:
33
33
  fast_finish: true
data/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
- ## 4.1.0
1
+ ## 4.2.0 (2016-05-31)
2
+
3
+ ### Breaking Changes
4
+
5
+ - None
6
+
7
+ ### Added
8
+
9
+ - [#808](https://github.com/airblade/paper_trail/pull/808) -
10
+ Warn when destroy callback is set to :after with ActiveRecord 5
11
+ option `belongs_to_required_by_default` set to `true`.
12
+
13
+ ### Fixed
14
+
15
+ - None
16
+
17
+ ## 4.1.0 (2016-01-30)
2
18
 
3
19
  ### Breaking Changes
4
20
 
data/README.md CHANGED
@@ -10,8 +10,7 @@ has been destroyed.
10
10
 
11
11
  | Version | Documentation |
12
12
  | -------------- | ------------- |
13
- | 4.1 | https://github.com/airblade/paper_trail/blob/4.1-stable/README.md |
14
- | 4.0 | https://github.com/airblade/paper_trail/blob/4.0-stable/README.md |
13
+ | 4 | https://github.com/airblade/paper_trail/blob/4-stable/README.md |
15
14
  | 3 | https://github.com/airblade/paper_trail/blob/3.0-stable/README.md |
16
15
  | 2 | https://github.com/airblade/paper_trail/blob/2.7-stable/README.md |
17
16
  | 1 | https://github.com/airblade/paper_trail/blob/rails2/README.md |
@@ -48,7 +47,7 @@ has been destroyed.
48
47
 
49
48
  | paper_trail | branch | tags | ruby | activerecord |
50
49
  | ----------- | ---------- | ------ | -------- | ------------ |
51
- | 4 | master | v4.x | >= 1.8.7 | >= 3.0, < 6 |
50
+ | 4 | 4-stable | v4.x | >= 1.8.7 | >= 3.0, < 6 |
52
51
  | 3 | 3.0-stable | v3.x | >= 1.8.7 | >= 3.0, < 5 |
53
52
  | 2 | 2.7-stable | v2.x | >= 1.8.7 | >= 3.0, < 4 |
54
53
  | 1 | rails2 | v1.x | >= 1.8.7 | >= 2.3, < 3 |
@@ -57,7 +56,7 @@ has been destroyed.
57
56
 
58
57
  1. Add PaperTrail to your `Gemfile`.
59
58
 
60
- `gem 'paper_trail', '~> 4.1.0'`
59
+ `gem 'paper_trail', '~> 4.2.0'`
61
60
 
62
61
  1. Add a `versions` table to your database.
63
62
 
@@ -1378,7 +1377,7 @@ setting up your app with PaperTrail will look something like this:
1378
1377
 
1379
1378
  1. Add PaperTrail to your `Gemfile`.
1380
1379
 
1381
- `gem 'paper_trail', '~> 4.1.0'`
1380
+ `gem 'paper_trail', '~> 4.2.0'`
1382
1381
 
1383
1382
  2. Generate a migration to add a `versions` table to your database.
1384
1383
 
@@ -1,9 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'activerecord', '~> 3.0'
4
- gem 'i18n', '~> 0.6.11'
3
+ gem 'activerecord', '3.2.22.2'
5
4
  gem 'request_store', '~> 1.1.0'
6
5
 
6
+ # i18n 0.7 requires ruby >= 1.9.3, but we still support 1.8.7
7
+ gem 'i18n', '< 0.7'
8
+
7
9
  # actionpack 3 depends on rack-cache ~> 1.2, but bundler seems to ignore that.
8
10
  # Also rack-cache 1.3 dropped support for ruby 1.8.7. The simplest thing for now
9
11
  # was to specify rack-cache ~> 1.2 here, though it should be unnecessary given
@@ -15,15 +17,11 @@ group :development, :test do
15
17
  gem 'shoulda', '~> 3.5'
16
18
  gem 'ffaker', '<= 1.31.0'
17
19
 
18
- # Testing of Rails
19
- gem 'railties', '~> 3.0'
20
-
21
20
  # Testing of Sinatra
22
- gem 'sinatra', '~> 1.0'
23
- gem 'rack-test', '>= 0.6'
21
+ gem 'sinatra', '~> 1.1.4'
24
22
 
25
23
  # RSpec testing
26
- gem 'rspec-rails', '~> 3.1.0'
24
+ gem 'rspec-rails', '~> 3.4.2'
27
25
  gem 'generator_spec'
28
26
 
29
27
  # To do proper transactional testing with ActiveSupport::TestCase on MySQL
@@ -120,9 +120,18 @@ module PaperTrail
120
120
  fail ArgumentError, 'recording order can only be "after" or "before"'
121
121
  end
122
122
 
123
- send "#{recording_order}_destroy",
124
- :record_destroy,
125
- :if => :save_version?
123
+ if recording_order.to_s == 'after' and
124
+ Gem::Version.new(ActiveRecord::VERSION::STRING).release >= Gem::Version.new("5")
125
+ if ::ActiveRecord::Base.belongs_to_required_by_default
126
+ ::ActiveSupport::Deprecation.warn(
127
+ "paper_trail_on_destroy(:after) is incompatible with ActiveRecord " +
128
+ "belongs_to_required_by_default and has no effect. Please use :before " +
129
+ "or disable belongs_to_required_by_default."
130
+ )
131
+ end
132
+ end
133
+
134
+ send "#{recording_order}_destroy", :record_destroy, :if => :save_version?
126
135
 
127
136
  return if paper_trail_options[:on].include?(:destroy)
128
137
  paper_trail_options[:on] << :destroy
@@ -1,7 +1,7 @@
1
1
  module PaperTrail
2
2
  module VERSION
3
3
  MAJOR = 4
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
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: 4.1.0
4
+ version: 4.2.0
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-01-30 00:00:00.000000000 Z
12
+ date: 2016-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -283,7 +283,7 @@ files:
283
283
  - README.md
284
284
  - Rakefile
285
285
  - doc/bug_report_template.rb
286
- - gemfiles/3.0.gemfile
286
+ - gemfiles/ar3.gemfile
287
287
  - lib/generators/paper_trail/USAGE
288
288
  - lib/generators/paper_trail/install_generator.rb
289
289
  - lib/generators/paper_trail/templates/add_object_changes_to_versions.rb
@@ -448,7 +448,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
448
448
  version: 1.3.6
449
449
  requirements: []
450
450
  rubyforge_project:
451
- rubygems_version: 2.4.6
451
+ rubygems_version: 2.5.1
452
452
  signing_key:
453
453
  specification_version: 4
454
454
  summary: Track changes to your models' data. Good for auditing or versioning.