paper_trail 5.0.0 → 5.0.1

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: a998b8383ac675662fac129fce0617b3c2f13351
4
- data.tar.gz: c431eeedc5dec2b6882775a95ea6ef79df63f2a9
3
+ metadata.gz: 9cd678385e88cdbf152ecc4c2a4a1876afd7a175
4
+ data.tar.gz: 93e28bbba83f8be22cfb8db3ee3e1912818f86af
5
5
  SHA512:
6
- metadata.gz: 1108f2949a0a98f6ad9e7f75eba6b2d40d21209de2beb6c856142930aa58b8f0f7c65fa1cf9fe73dd9fc3b70c22afc8886846581d992eb0ac9934504205db960
7
- data.tar.gz: 1db8e0b3427d3801672829e014dcf1035f55ea75fecb54bebbeb5d6d54f0203d57bedce6ed5307fd5dfa8a68ebd971bc16ed4ad923fac4d9a46ff1c9f1aea0e5
6
+ metadata.gz: 19a6e0288279964bced8ca4d4ae4ccacd668e1750dbff133d8c6e3ee76514c150402669c808954b24efcfb0fa085b370e3c20d2afe667bd4385d4ea233f4449e
7
+ data.tar.gz: b26460e5948b60afb39fc6dc18c04f7c3337d449dc8a0401efc67d3cdabaa193fd3f23341d8d4f44f8ed726af4e5f81079d7be24372b3a6d8dbae683d852e44b
@@ -98,6 +98,7 @@ DB=postgres bundle exec rake
98
98
  - update any other references to version number
99
99
  1. Commit and tag with `git tag -a -m "v5.0.0" "v5.0.0"`
100
100
  1. `git push --tags origin master`
101
- 1. `gem push paper_trail`
101
+ 1. `gem build paper_trail.gemspec`
102
+ 1. `gem push paper_trail-5.0.0.gem`
102
103
 
103
104
  [1]: https://github.com/airblade/paper_trail/blob/master/doc/bug_report_template.rb
@@ -1,3 +1,21 @@
1
+ ## 5.0.1 (2016-05-04)
2
+
3
+ ### Breaking Changes
4
+
5
+ - None
6
+
7
+ ### Added
8
+
9
+ - None
10
+
11
+ ### Fixed
12
+
13
+ - [#791](https://github.com/airblade/paper_trail/issues/791) -
14
+ A rare issue in applications that override `warn`.
15
+ - [#789](https://github.com/airblade/paper_trail/issues/789) -
16
+ A potentially common issue, in applications with initializers that use
17
+ versioned models.
18
+
1
19
  ## 5.0.0 (2016-05-02)
2
20
 
3
21
  ### Breaking Changes
data/README.md CHANGED
@@ -38,6 +38,8 @@ has been destroyed.
38
38
  - [Finding Out Who Was Responsible For A Change](#finding-out-who-was-responsible-for-a-change)
39
39
  - [Associations](#associations)
40
40
  - [Storing metadata](#storing-metadata)
41
+ - ActiveRecord
42
+ - [Single Table Inheritance](#single-table-tnheritance)
41
43
  - Extensibility
42
44
  - [Custom Version Classes](#custom-version-classes)
43
45
  - [Custom Serializer](#custom-serializer)
@@ -980,6 +982,23 @@ end
980
982
  If you're using [strong_parameters][18] instead of [protected_attributes][17]
981
983
  then there is no need to use `attr_accessible`.
982
984
 
985
+ ## Single Table Inheritance (STI)
986
+
987
+ PaperTrail supports [Single Table Inheritance][39], and even supports an
988
+ un-versioned base model, as of 23ffbdc7e1.
989
+
990
+ ```ruby
991
+ class Fruit < ActiveRecord::Base
992
+ # un-versioned base model
993
+ end
994
+ class Banana < Fruit
995
+ has_paper_trail
996
+ end
997
+ ```
998
+
999
+ However, there is a known issue when reifying [associations](#associations),
1000
+ see https://github.com/airblade/paper_trail/issues/594
1001
+
983
1002
  ## Custom Version Classes
984
1003
 
985
1004
  You can specify custom version subclasses with the `:class_name` option:
@@ -1554,3 +1573,5 @@ Released under the MIT licence.
1554
1573
  [36]: http://www.postgresql.org/docs/9.4/interactive/ddl.html
1555
1574
  [37]: https://github.com/ankit1910/paper_trail-globalid
1556
1575
  [38]: https://github.com/sferik/rails_admin
1576
+ [39]: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#class-ActiveRecord::Base-label-Single+table+inheritance
1577
+ [40]: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Polymorphic+Associations
@@ -40,7 +40,7 @@ module PaperTrail
40
40
  def add_paper_trail_migration(template)
41
41
  migration_dir = File.expand_path("db/migrate")
42
42
  if self.class.migration_exists?(migration_dir, template)
43
- warn "Migration already exists: #{template}"
43
+ ::Kernel.warn "Migration already exists: #{template}"
44
44
  else
45
45
  migration_template "#{template}.rb", "db/migrate/#{template}.rb"
46
46
  end
@@ -176,6 +176,10 @@ unless PaperTrail.active_record_protected_attributes?
176
176
  end
177
177
  end
178
178
 
179
+ ActiveSupport.on_load(:active_record) do
180
+ include PaperTrail::Model
181
+ end
182
+
179
183
  # Require frameworks
180
184
  require "paper_trail/frameworks/sinatra"
181
185
  if defined?(::Rails) && ActiveRecord::VERSION::STRING >= "3.2"
@@ -2,7 +2,3 @@
2
2
  # since otherwise the model(s) will get loaded in via the `Rails::Engine`.
3
3
  require "paper_trail/frameworks/active_record/models/paper_trail/version_association"
4
4
  require "paper_trail/frameworks/active_record/models/paper_trail/version"
5
-
6
- ActiveSupport.on_load(:active_record) do
7
- include PaperTrail::Model
8
- end
@@ -94,7 +94,7 @@ module PaperTrail
94
94
  user_present = user_for_paper_trail.present?
95
95
  whodunnit_blank = ::PaperTrail.whodunnit.blank?
96
96
  if enabled && user_present && whodunnit_blank && !@set_paper_trail_whodunnit_called
97
- warn <<-EOS.strip_heredoc
97
+ ::Kernel.warn <<-EOS.strip_heredoc
98
98
  user_for_paper_trail is present, but whodunnit has not been set.
99
99
  PaperTrail no longer adds the set_paper_trail_whodunnit
100
100
  before_filter for you. Please add this before_filter to your
@@ -5,7 +5,6 @@ module PaperTrail
5
5
  paths["app/models"] << "lib/paper_trail/frameworks/active_record/models"
6
6
  config.paper_trail = ActiveSupport::OrderedOptions.new
7
7
  initializer "paper_trail.initialisation" do |app|
8
- ActiveRecord::Base.send :include, PaperTrail::Model
9
8
  PaperTrail.enabled = app.config.paper_trail.fetch(:enabled, true)
10
9
  end
11
10
  end
@@ -3,7 +3,7 @@ module PaperTrail
3
3
  module VERSION
4
4
  MAJOR = 5
5
5
  MINOR = 0
6
- TINY = 0
6
+ TINY = 1
7
7
  PRE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
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.0.0
4
+ version: 5.0.1
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-05-02 00:00:00.000000000 Z
12
+ date: 2016-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord