diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 03:00:14 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 03:00:30 +0530 |
commit | a9c790e10ffd06294200dbbed4692fbd60424800 (patch) | |
tree | c8c5fee32368261e99c6cf3b85ab5949e2cc17b5 /activerecord | |
parent | 4c5b5024c36cfc6dabfdfed656d04d3c4e032e44 (diff) | |
download | rails-a9c790e10ffd06294200dbbed4692fbd60424800.tar.gz rails-a9c790e10ffd06294200dbbed4692fbd60424800.tar.bz2 rails-a9c790e10ffd06294200dbbed4692fbd60424800.zip |
Simply methods for checking eager loaded tables references in the query
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 80e6acf34c..24ea8cef33 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1830,22 +1830,22 @@ module ActiveRecord 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) |