Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't reinitialize the arel_table unless the table_name changes

  • Loading branch information...
commit 84f71e42b79f00a97e95f6f472903b553ceda8ef 1 parent 35ae29f
@dmathieu dmathieu authored tenderlove committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  activerecord/lib/active_record/base.rb
View
3  activerecord/lib/active_record/base.rb
@@ -659,6 +659,7 @@ def reset_sequence_name #:nodoc:
def set_table_name(value = nil, &block)
@quoted_table_name = nil
define_attr_method :table_name, value, &block
+ @arel_table = nil
@relation = Relation.new(self, arel_table)
end
@@ -891,7 +892,7 @@ def sti_name
end
def arel_table
- Arel::Table.new(table_name, arel_engine)
+ @arel_table ||= Arel::Table.new(table_name, arel_engine)
end
def arel_engine
Please sign in to comment.
Something went wrong with that request. Please try again.