#---
# Excerpted from "Rails Recipes"
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/fr_rr for more book information.
#---

class Magazine < ActiveRecord::Base            
  has_many :subscriptions
  has_many :readers, :through => :subscriptions  
end          


class Magazine < ActiveRecord::Base 
  has_many :subscriptions
  has_many :readers, :through => :subscriptions       
  has_many :semiannual_subscribers, 
           :through => :subscriptions, 
           :source => :reader,
           :conditions => ['length_in_issues = 6']        
end

