Now you have the opposite problem... You are now calling list as an instance
method and you have it defined as a class method.

You need to do ONE of the following.

Define it as a class method, and call it as a class method:

def self.list
code
end

@list = Sale.list

Define it as an instance method and call it as an instance method:

def list
code
end

@list = Sale.new.list

However, based on what the list method does, it's probably best that you do
the former and have it be a class method.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/BaQUoI1plSUJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 8 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 14, '11 at 12:14p
activeOct 6, '12 at 12:28p
posts8
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase