Skip to content

Commit 1a64730

Browse files
sickatectran
authored andcommitted
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
1 parent fc5329b commit 1a64730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/annotate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def self.eager_load(options)
137137
load_requires(options)
138138
require 'annotate/active_record_patch'
139139

140-
if defined?(Rails)
140+
if defined?(Rails::Application)
141141
if Rails.version.split('.').first.to_i < 3
142142
Rails.configuration.eager_load_paths.each do |load_path|
143143
matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/

0 commit comments

Comments
 (0)