method
include_eager_conditions?
v1.1.6 -
Show latest stable
- Class:
ActiveRecord::Associations::ClassMethods
include_eager_conditions?(options)private
Checks if the conditions reference a table other than the current model table
# File activerecord/lib/active_record/associations.rb, line 1197
def include_eager_conditions?(options)
# look in both sets of conditions
conditions = [scope(:find, :conditions), options[:conditions]].inject([]) do |all, cond|
case cond
when nil then all
when Array then all << cond.first
else all << cond
end
end
return false unless conditions.any?
conditions.join(' ').scan(/(\w+)\.\w+/).flatten.any? do |condition_table_name|
condition_table_name != table_name
end
end Related methods
- Instance methods
- belongs_to
- has_and_belongs_to_many
- has_many
- has_one
- Private methods
-
add_association_callbacks -
add_deprecated_api_for_has_many -
add_limited_ids_condition! -
add_multiple_associated_save_callbacks -
association_accessor_methods -
association_constructor_method -
collection_accessor_methods -
collection_reader_method -
column_aliases -
condition_word -
configure_dependency_for_has_many -
configure_dependency_for_has_one -
construct_counter_sql_with_included_associations -
construct_finder_sql_for_association_limiting -
construct_finder_sql_with_included_associations -
count_with_associations -
create_belongs_to_reflection -
create_extension_module -
create_has_and_belongs_to_many_reflection -
create_has_many_reflection -
create_has_one_reflection -
find_with_associations -
guard_against_unlimitable_reflections -
include_eager_conditions? -
include_eager_order? -
join_table_name -
reflect_on_included_associations -
require_association_class -
select_all_rows -
select_limited_ids_list -
using_limitable_reflections?