Skip to content
Browse files

Simply methods for checking eager loaded tables references in the query

  • Loading branch information...
1 parent 4c5b502 commit a9c790e10ffd06294200dbbed4692fbd60424800 @lifo lifo committed Jan 3, 2010
Showing with 7 additions and 7 deletions.
  1. +7 −7 activerecord/lib/active_record/associations.rb
View
14 activerecord/lib/active_record/associations.rb
@@ -1830,22 +1830,22 @@ def joined_tables(options)
end
# Checks if the conditions reference a table other than the current model table
- def include_eager_conditions?(options, tables = nil, joined_tables = nil)
- ((tables || conditions_tables(options)) - (joined_tables || joined_tables(options))).any?
+ def include_eager_conditions?(options, joined_tables)
+ (conditions_tables(options) - joined_tables).any?
end
# Checks if the query order references a table other than the current model's table.
- def include_eager_order?(options, tables = nil, joined_tables = nil)
- ((tables || order_tables(options)) - (joined_tables || joined_tables(options))).any?
+ def include_eager_order?(options, joined_tables)
+ (order_tables(options) - joined_tables).any?
end
- def include_eager_select?(options, joined_tables = nil)
- (selects_tables(options) - (joined_tables || joined_tables(options))).any?
+ def include_eager_select?(options, joined_tables)
+ (selects_tables(options) - joined_tables).any?
end
def references_eager_loaded_tables?(options)
joined_tables = joined_tables(options)
- include_eager_order?(options, nil, joined_tables) || include_eager_conditions?(options, nil, joined_tables) || include_eager_select?(options, joined_tables)
+ include_eager_order?(options, joined_tables) || include_eager_conditions?(options, joined_tables) || include_eager_select?(options, joined_tables)
end
def using_limitable_reflections?(reflections)

0 comments on commit a9c790e

Please sign in to comment.
Something went wrong with that request. Please try again.