diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-30 15:15:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-08-30 15:15:17 -0700 |
commit | c2be6ace40f016001043b84fe80170068eacee78 (patch) | |
tree | da5302cde371ba7008a14f73316a320b203985c7 | |
parent | 64669c11174162560aa490b57f2f8b0e45620fc7 (diff) | |
download | rails-c2be6ace40f016001043b84fe80170068eacee78.tar.gz rails-c2be6ace40f016001043b84fe80170068eacee78.tar.bz2 rails-c2be6ace40f016001043b84fe80170068eacee78.zip |
no need for the const_get since we lock
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index dd7d2582a0..2b132d517d 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -90,11 +90,7 @@ module ActiveRecord # 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 |