Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cache Model.arel_table

  • Loading branch information...
commit 6e3bee6cf1f0d2684152292db0a8b757249824fd 1 parent 6806483
@lifo lifo authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/base.rb
View
6 activerecord/lib/active_record/base.rb
@@ -1388,7 +1388,7 @@ def column_methods_hash #:nodoc:
def reset_column_information
undefine_attribute_methods
@column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @inheritance_column = nil
- @arel_engine = @unscoped = nil
+ @arel_engine = @unscoped = @arel_table = nil
end
def reset_column_information_and_inheritable_attributes_for_all_subclasses#:nodoc:
@@ -1506,8 +1506,8 @@ def unscoped
finder_needs_type_condition? ? @unscoped.where(type_condition) : @unscoped
end
- def arel_table(table_name_alias = nil)
- Arel::Table.new(table_name, :as => table_name_alias, :engine => arel_engine)
+ def arel_table
+ @arel_table ||= Arel::Table.new(table_name, :engine => arel_engine)
end
def arel_engine
Please sign in to comment.
Something went wrong with that request. Please try again.