From bf043f25b57e22e775a4706cde89d2b8dc267c5c Mon Sep 17 00:00:00 2001 From: Thies C. Arntzen Date: Wed, 18 Aug 2010 17:34:00 +0200 Subject: [PATCH] Cache result of find_sti_class. [#5403 state:resolved] --- activerecord/lib/active_record/base.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 9d3ee95..f488b19 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -429,6 +429,8 @@ module ActiveRecord #:nodoc: self.default_scoping = [] class << self # Class methods + extend ActiveSupport::Memoizable + def colorize_logging(*args) ActiveSupport::Deprecation.warn "ActiveRecord::Base.colorize_logging and " << "config.active_record.colorize_logging are deprecated. Please use " << @@ -928,7 +930,8 @@ module ActiveRecord #:nodoc: end end end - + memoize :find_sti_class + def construct_finder_arel(options = {}, scope = nil) relation = options.is_a?(Hash) ? unscoped.apply_finder_options(options) : unscoped.merge(options) relation = scope.merge(relation) if scope -- 1.7.1.1