Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Rails.root if available over RAILS_ROOT

  • Loading branch information...
commit eae91c746d569850acc4fb95d1fe1902c603ecd1 1 parent 7aa2b7b
@Sutto Sutto authored committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/validation_reflection.rb
View
6 lib/validation_reflection.rb
@@ -32,8 +32,10 @@ module ValidationReflection # :nodoc:
extend self
- # Look for config/initalizer here in:
- CONFIG_PATH = ::Dir.glob((::File.join(RAILS_ROOT, 'config', '**', 'validation_reflection.rb').to_s rescue '')).first || ''
+ require_path = ::File.join((defined?(Rails) ? Rails.root : RAILS_ROOT), 'config', '**', 'validation_reflection.rb').to_s rescue ''
+
+ # Look for config/initializer here in:
+ CONFIG_PATH = ::Dir.glob(require_path).first || ''
CORE_VALIDATONS = [
:validates_acceptance_of,
:validates_associated,
Please sign in to comment.
Something went wrong with that request. Please try again.