Report abuse

1
2
3
4
5
6
7
8
9
10
11
class Album < Product
  belongs_to :artist
  has_many :tracks, :order => 'position', :dependent => true,
    :foreign_key => 'product_id'

  def self.featured_products
    find(:all, :include => :artist, 
      :conditions => [ 'featured is not null' ],
      :order => 'featured desc')
  end
end