diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-14 17:53:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-14 17:53:20 -0700 |
commit | 62dd1d8d23c843fa4839e47b9e67d84c15a61f35 (patch) | |
tree | a6ea647b28b552cf34bc63d1085329a0bcaff6b9 /activerecord/lib/active_record | |
parent | 3c300b31219f2af3ecd46ef22b04e5c5548db899 (diff) | |
download | rails-62dd1d8d23c843fa4839e47b9e67d84c15a61f35.tar.gz rails-62dd1d8d23c843fa4839e47b9e67d84c15a61f35.tar.bz2 rails-62dd1d8d23c843fa4839e47b9e67d84c15a61f35.zip |
clean up ||= with an initialized variable and attr_reader
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 65daa8ffbe..9fe8d54f02 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1965,7 +1965,7 @@ module ActiveRecord end class JoinAssociation < JoinBase # :nodoc: - attr_reader :reflection, :parent, :aliased_table_name, :aliased_prefix, :aliased_join_table_name, :parent_table_name + attr_reader :reflection, :parent, :aliased_table_name, :aliased_prefix, :aliased_join_table_name, :parent_table_name, :join_class delegate :options, :klass, :through_reflection, :source_reflection, :to => :reflection def initialize(reflection, join_dependency, parent = nil) @@ -1982,6 +1982,7 @@ module ActiveRecord @parent_table_name = parent.active_record.table_name @aliased_table_name = aliased_table_name_for(table_name) @join = nil + @join_class = Arel::InnerJoin if reflection.macro == :has_and_belongs_to_many @aliased_join_table_name = aliased_table_name_for(reflection.options[:join_table], "_join") @@ -2004,10 +2005,6 @@ module ActiveRecord end end - def join_class - @join_class ||= Arel::InnerJoin - end - def with_join_class(join_class) @join_class = join_class self |