aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index c51210ef1f..ba7f34d729 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -581,7 +581,9 @@ module ActiveRecord
end
def require_association_class(class_name)
- begin
+ return unless class_name
+
+ begin
require_association(Inflector.underscore(class_name))
rescue LoadError
# Failed to load the associated class -- let's hope the developer is doing the requiring himself.