#---
# 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.
#---

require "grade_finder"
class Student < ActiveRecord::Base
  has_many :grades, :extend => GradeFinder 
end


class Student < ActiveRecord::Base
  has_many :grades
end


class Student < ActiveRecord::Base
  has_many :grades do 
    def below_average
      find(:all, :conditions => ['score < ?', 2])        
    end
    def foo
      raise self.inspect
    end
  end
end

