title: Retrieving attributes through rails join table
body: <p>I have 3 models: products, tags and products_tags:</p>
  
  <p>Tag model:</p>
  
  <pre><code>class Tag &lt; ActiveRecord::Base
          has_many :products, :through =&gt; :products_tags
          has_many :products_tags
  end
  </code></pre>
  
  <p>Product Model:</p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
    has_many :tags, :through =&gt; :products_tags
    has_many :products_tags
    accepts_nested_attributes_for :tags
    accepts_nested_attributes_for :products_tags
  </code></pre>
  
  <p>Join: </p>
  
  <pre><code>class ProductsTag &lt; ActiveRecord::Base
    belongs_to :product
    belongs_to :tag
  end
  </code></pre>
  
  <p>I need a query which will retrieve the attributes related to the tag and the product model, as an AREL object. </p>
  
  <p>So for example: </p>
  
  <p>My tag table has 1 field: Cat_name 
  My product table has: Title, URL, Image_url.</p>
  
  <p>How can I retrieve all these attributes as an AREL record.</p>