aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index ecad32ebe2..b91ebafee5 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1000,7 +1000,7 @@ module ActiveRecord #:nodoc:
# Nest the type name in the same module as this class.
# Bar is "MyApp::Business::Bar" relative to MyApp::Business::Foo
def type_name_with_module(type_name)
- "#{self.name.sub(/(::)?[^:]+$/, '')}#{$1}#{type_name}"
+ (/^::/ =~ type_name) ? type_name : "#{parent.name}::#{type_name}"
end
def construct_finder_sql(options)