In this code below, ActiveRecord returns data from associations I don't
want.

class Article < ActiveRecord::Base

  has_many  :extras
  has_many  :pages, :order => 'sortOrder'
  has_many  :assets

  def get_list
    return self.find(:all,
      :include    => :extras,
      :conditions => ["publishable='Y'"])
  end
end

Without the :include statement, we get the usual lazy load, and no
associations are loaded, only the attributes of the Article.

However, I want data from the :extras association and not the others.

When I use the code above, I get data from Article (good), Extras
(good), and Assets (bad), and nothing from Pages (curious).

I don't understand why Assets is being included, and I don't know how to
keep that data out of the results.

What am I missing? Thx.

-- gw
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to