Permalink
Browse files

avoid deprecated methods

  • Loading branch information...
tenderlove committed Dec 1, 2010
1 parent d321e78 commit a5e7d9f1e00ca6a0af6931f6a064e77004b4e3ff
@@ -376,7 +376,7 @@ def method_missing(method, *args, &block)
def references_eager_loaded_tables?
# always convert table names to downcase as in Oracle quoted table names are in uppercase
- joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.map{ |t| t.downcase }.uniq
+ joined_tables = (tables_in_string(arel.join_sql) + [table.name, table.table_alias]).compact.map{ |t| t.downcase }.uniq
(tables_in_string(to_sql) - joined_tables).any?
end
@@ -166,7 +166,7 @@ def perform_calculation(operation, column_name, options = {})
if operation == "count"
column_name ||= (select_for_count || :all)
- if arel.joins(arel) =~ /LEFT OUTER/i
+ if arel.join_sql =~ /LEFT OUTER/i
distinct = true
column_name = @klass.primary_key if column_name == :all
end
@@ -194,7 +194,7 @@ def find_with_associations
def construct_relation_for_association_calculations
including = (@eager_load_values + @includes_values).uniq
- join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, arel.joins(arel))
+ join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, arel.join_sql)
relation = except(:includes, :eager_load, :preload)
apply_join_dependency(relation, join_dependency)
end
@@ -168,7 +168,7 @@ def custom_join_sql(*joins)
arel.join(join)
end
- arel.joins(arel)
+ arel.join_sql
end
def build_arel

0 comments on commit a5e7d9f

Please sign in to comment.