Fix ActiveRecord version check (#956)
* Fix ActiveRecord version check * Update changelog for #956 * Simplify ActiveRecord version check
This commit is contained in:
parent
72c4d1f689
commit
b0b201aa65
|
@ -16,7 +16,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- None
|
- [#956](https://github.com/airblade/paper_trail/pull/956) -
|
||||||
|
Fix ActiveRecord >= 5.1 version check
|
||||||
|
|
||||||
## 7.0.1 (2017-04-10)
|
## 7.0.1 (2017-04-10)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
module PaperTrail
|
module PaperTrail
|
||||||
# Represents the "paper trail" for a single record.
|
# Represents the "paper trail" for a single record.
|
||||||
class RecordTrail
|
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)
|
def initialize(record)
|
||||||
@record = record
|
@record = record
|
||||||
|
|
Loading…
Reference in New Issue