Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

no need for the const_get since we lock

  • Loading branch information...
commit c2be6ace40f016001043b84fe80170068eacee78 1 parent 64669c1
@tenderlove tenderlove authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 activerecord/lib/active_record/relation/delegation.rb
View
6 activerecord/lib/active_record/relation/delegation.rb
@@ -90,11 +90,7 @@ def relation_class_for(klass)
# Cache#compute_if_absent guarantees that the block will only executed once for the given klass_name
subclass_name = "#{name.gsub('::', '_')}_#{klass_name.gsub('::', '_')}"
- if const_defined?(subclass_name)
- const_get(subclass_name)
- else
- const_set(subclass_name, Class.new(self) { include ClassSpecificRelation })
- end
+ const_set(subclass_name, Class.new(self) { include ClassSpecificRelation })
end
else
self
Please sign in to comment.
Something went wrong with that request. Please try again.