From 58b0bad32bee48a2fd90d437bb706f0691080ac8 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Fri, 29 Aug 2014 18:34:30 -0400 Subject: [PATCH] close #406; close #401 Do not load the PaperTrail::Version class in via a Rails::Engine when used with Rails; feature pushed to 3.1.0 --- CHANGELOG.md | 2 -- lib/paper_trail.rb | 6 +----- lib/paper_trail/frameworks/rails.rb | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7df4928..78fc103f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,6 @@ - [#372](https://github.com/airblade/paper_trail/pull/372) - Use [Arel](https://github.com/rails/arel) for SQL construction. - [#365](https://github.com/airblade/paper_trail/issues/365) - `VersionConcern#version_at` should return `nil` when receiving a timestamp that occured after the object was destroyed. - - [#347](https://github.com/airblade/paper_trail/pull/347) - Autoload `ActiveRecord` models in via a `Rails::Engine` when - the gem is used with `Rails`. - Expand `PaperTrail::VERSION` into a module, mimicking the form used by Rails to give it some additional modularity & versatility. - Fixed `VersionConcern#index` instance method so that it conforms to using the primary key for ordering when possible. diff --git a/lib/paper_trail.rb b/lib/paper_trail.rb index 8b295fff..ba771197 100644 --- a/lib/paper_trail.rb +++ b/lib/paper_trail.rb @@ -126,10 +126,6 @@ end # Require frameworks require 'paper_trail/frameworks/sinatra' -if defined? Rails - require 'paper_trail/frameworks/rails' -else - require 'paper_trail/frameworks/active_record' -end +require 'paper_trail/frameworks/active_record' require 'paper_trail/frameworks/rspec' if defined? RSpec require 'paper_trail/frameworks/cucumber' if defined? World diff --git a/lib/paper_trail/frameworks/rails.rb b/lib/paper_trail/frameworks/rails.rb index 0601f77a..55dd9f91 100644 --- a/lib/paper_trail/frameworks/rails.rb +++ b/lib/paper_trail/frameworks/rails.rb @@ -1,5 +1,4 @@ require 'paper_trail/frameworks/rails/controller' -require 'paper_trail/frameworks/rails/engine' module PaperTrail module Rails