Fix ActiveRecord version check (#956)

* Fix ActiveRecord version check

* Update changelog for #956

* Simplify ActiveRecord version check
This commit is contained in:
newtrat 2017-04-26 13:50:24 -04:00 committed by Jared Beck
parent 72c4d1f689
commit b0b201aa65
2 changed files with 4 additions and 2 deletions

View File

@ -16,7 +16,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
### Fixed
- None
- [#956](https://github.com/airblade/paper_trail/pull/956) -
Fix ActiveRecord >= 5.1 version check
## 7.0.1 (2017-04-10)

View File

@ -1,7 +1,8 @@
module PaperTrail
# Represents the "paper trail" for a single record.
class RecordTrail
RAILS_GTE_5_1 = ::ActiveRecord::VERSION::MAJOR >= 5 && ::ActiveRecord::VERSION::MINOR >= 1
RAILS_GTE_5_1 = ::ActiveRecord.respond_to?(:gem_version) &&
::ActiveRecord.gem_version >= ::Gem::Version.new("5.1.0.beta1")
def initialize(record)
@record = record