instance method build_conditions

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.0.20

Signature

build_conditions()

No documentation comment.

Source
# File activerecord/lib/active_record/associations/through_association_scope.rb, line 122
      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_and_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

Defined in activerecord/lib/active_record/associations/through_association_scope.rb line 122 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Associations::ThroughAssociationScope

Type at least 2 characters to search.

↑↓ navigate · open · esc close