Flowdock
method

build_conditions

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveRecord::Associations::HasManyThroughAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v6.1.7.7:

build_conditions() protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/has_many_through_association.rb, line 215
        def build_conditions
          association_conditions = @reflection.options[:conditions]
          through_conditions = build_through_conditions
          source_conditions = @reflection.source_reflection.options[:conditions]
          uses_sti = !@reflection.through_reflection.klass.descends_from_active_record?

          if association_conditions || through_conditions || source_conditions || uses_sti
            all = []

            [association_conditions, source_conditions].each do |conditions|
              all << interpolate_sql(sanitize_sql(conditions)) if conditions
            end

            all << through_conditions  if through_conditions
            all << build_sti_condition if uses_sti

            all.map { |sql| "(#{sql})" } * ' AND '
          end
        end
Register or log in to add new notes.