From a60334fdc5d4f612bd2dd70e38d1e57481cd5910 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Wed, 19 Aug 2009 19:36:06 -0300 Subject: Remove useless conditionals/local var. --- activerecord/lib/active_record/associations.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 068943c454..b363cceccb 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -2089,8 +2089,6 @@ module ActiveRecord ] when :has_many, :has_one if reflection.options[:through] - through_conditions = through_reflection.options[:conditions] ? "AND #{interpolate_sql(sanitize_sql(through_reflection.options[:conditions]))}" : '' - jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil first_key = second_key = as_extra = nil @@ -2154,7 +2152,7 @@ module ActiveRecord as_extra] ] - elsif reflection.options[:as] && [:has_many, :has_one].include?(reflection.macro) + elsif reflection.options[:as] "%s.%s = %s.%s AND %s.%s = %s" % [ connection.quote_table_name(aliased_table_name), "#{reflection.options[:as]}_id", @@ -2180,8 +2178,6 @@ module ActiveRecord connection.quote_table_name(parent.aliased_table_name), options[:foreign_key] || reflection.primary_key_name ] - else - "" end @join << %(AND %s) % [ klass.send(:type_condition, aliased_table_name)] unless klass.descends_from_active_record? -- cgit v1.2.3