method

conditions

Importance_2
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveRecord::Reflection::ThroughReflection

Method deprecated or moved

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

These similar methods exist in v7.1.3.2:

conditions() public

Consider the following example:

class Person
  has_many :articles
  has_many :comment_tags, :through => :articles
end

class Article
  has_many :comments
  has_many :comment_tags, :through => :comments, :source => :tags
end

class Comment
  has_many :tags
end

There may be conditions on Person.comment_tags, Article.comment_tags and/or Comment.tags, but only Comment.tags will be represented in the #chain. So this method creates an array of conditions corresponding to the chain. Each item in the #conditions array corresponds to an item in the #chain, and is itself an array of conditions from an arbitrary number of relevant reflections, plus any :source_type or polymorphic :as constraints.

Show source
Register or log in to add new notes.