On Thu, Jan 15, 2009 at 11:21 AM, Tom M <thomas.mack...@gmail.com> wrote:
> > I may be overlooking something, but it seems to me that it is a > problem if with this code... > > Class Blog < ActiveRecord::Base > named_scope :unseen, :conditions => "displayed IS NULL" > end > > this test fails... > > it "should give a list of unseen entries" do > Blog.expects :unseen > b = Blog.new > b.unseen > end > > I don't know if this will help or not, but the little I've used named scopes, I've used them as class methods, not as instance methods, i.e. Blog.unseen not b.unseen. --wpd --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---