提交 e924814b 编写于 作者: A Aaron Patterson

just allocate the table in initialize

上级 8c822e8e
......@@ -42,6 +42,9 @@ def initialize(reflection, join_dependency, parent = nil)
# depends on the state of the join dependency, but we want it to work the same way
# every time.
allocate_aliases
@table = Arel::Table.new(
table_name, :as => aliased_table_name, :engine => arel_engine
)
end
def ==(other)
......@@ -65,12 +68,7 @@ def join_relation(joining_relation)
joining_relation.joins(self)
end
def table
@table ||= Arel::Table.new(
table_name, :as => aliased_table_name, :engine => arel_engine
)
end
attr_reader :table
# More semantic name given we are talking about associations
alias_method :target_table, :table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册