1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Merge pull request #813 from md5/fix-belongs_to_required_by_default-warning

Fix deprecation warning for paper_trail_on_destroy(:after)
This commit is contained in:
Jared Beck 2016-05-31 19:43:07 -04:00
commit 7842ae8aa9

View file

@ -179,8 +179,8 @@ module PaperTrail
raise ArgumentError, 'recording order can only be "after" or "before"'
end
if recording_order == "after" &&
Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("5")
if recording_order.to_s == "after" &&
Gem::Version.new(ActiveRecord::VERSION::STRING).release >= Gem::Version.new("5")
if ::ActiveRecord::Base.belongs_to_required_by_default
::ActiveSupport::Deprecation.warn(
"paper_trail_on_destroy(:after) is incompatible with ActiveRecord " +