Skip to content

Commit

Permalink
Fix ActiveRecord version check (paper-trail-gem#956)
Browse files Browse the repository at this point in the history
* Fix ActiveRecord version check

* Update changelog for paper-trail-gem#956

* Simplify ActiveRecord version check
  • Loading branch information
newtrat authored and aried3r committed Dec 14, 2020
1 parent 837371a commit 93c9d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion lib/paper_trail/record_trail.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 93c9d2f

Please sign in to comment.