I have two models: cars and pictures in my RoR project
class Car < ActiveRecord::Base
has_many :pictures, :as => :imageable, :dependent => :destroy
end
and
class Picture < ActiveRecord::Base
belongs_to :imageable, :polymorphic => true, :dependent => :destroy
end
How I can find all cars only with child pictures?