Commit 1a647302 by sickcate Committed by Cuong Tran

use existence of 'Rails::Application' as indicator of Rails App instead of…

use existence of 'Rails::Application' as indicator of Rails App instead of 'Rails', as many Ruby applications are using railties such as generators outside Rails
parent fc5329b3
...@@ -137,7 +137,7 @@ module Annotate ...@@ -137,7 +137,7 @@ module Annotate
load_requires(options) load_requires(options)
require 'annotate/active_record_patch' require 'annotate/active_record_patch'
if defined?(Rails) if defined?(Rails::Application)
if Rails.version.split('.').first.to_i < 3 if Rails.version.split('.').first.to_i < 3
Rails.configuration.eager_load_paths.each do |load_path| Rails.configuration.eager_load_paths.each do |load_path|
matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/ matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment