instance method construct_conditions

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.0.20

Signature

construct_conditions()

Build SQL conditions from attributes, qualified by table name.

Source
# File activerecord/lib/active_record/associations/through_association_scope.rb, line 21
      def construct_conditions
        table_name = @reflection.through_reflection.quoted_table_name
        conditions = construct_quoted_owner_attributes(@reflection.through_reflection).map do |attr, value|
          "#{table_name}.#{attr} = #{value}"
        end
        conditions << sql_conditions if sql_conditions
        "(" + conditions.join(') AND (') + ")"
      end

Defined in activerecord/lib/active_record/associations/through_association_scope.rb line 21 · 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