diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 13:40:10 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 14:14:14 -0800 |
commit | e924814b28d655242a49f543cf453d55712071b1 (patch) | |
tree | dc0be406a931e7a54fbb793f684bc032e0cdeed8 /activerecord/lib/active_record/associations | |
parent | 8c822e8e2943ca138cc465f5619ce1f602214941 (diff) | |
download | rails-e924814b28d655242a49f543cf453d55712071b1.tar.gz rails-e924814b28d655242a49f543cf453d55712071b1.tar.bz2 rails-e924814b28d655242a49f543cf453d55712071b1.zip |
just allocate the table in initialize
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb index 25511a092f..b063d927b9 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb @@ -42,6 +42,9 @@ module ActiveRecord # 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 @@ module ActiveRecord 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 |