I just updated to rails (via gem) and now all my .find..... methods give me "wrong number of arguments(3 for 0)" with the exception of find_by_sql which works fine but I want to avoid for obvious reasons. I''ve tried simplifying everything down to the bare minimum Priorities.find(1) and I printed out Priority.table_name to confirm it was still correct. What gives? Did I screw up the upgrade process? Is there some secret bit I need to flip? -Kate (masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)
kate rhodes wrote:>I just updated to rails (via gem) and now all my .find..... methods >give me "wrong number of arguments(3 for 0)" with the exception of >find_by_sql which works fine but I want to avoid for obvious reasons. > >I''ve tried simplifying everything down to the bare minimum > >Priorities.find(1) > >and I printed out Priority.table_name to confirm it was still correct. > >What gives? Did I screw up the upgrade process? Is there some secret >bit I need to flip? > >-Kate >(masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org) >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >Isn''t "find" a existing method on one of the core classes... another post here earlier with similar problem ("View" I think". Try to change name of the method // JoNtE
I''m not following you. find IS one of the core methods. It''s the core method that broke. I don''t see how putting a wrapper around it would help. I''m not overriding it or doing anything funky. -Kate On Fri, 04 Mar 2005 07:36:40 +0100, Jonas Montonen <jonte-ZzdMY6JjovE@public.gmane.org> wrote:> kate rhodes wrote: > > >I just updated to rails (via gem) and now all my .find..... methods > >give me "wrong number of arguments(3 for 0)" with the exception of > >find_by_sql which works fine but I want to avoid for obvious reasons. > > > >I''ve tried simplifying everything down to the bare minimum > > > >Priorities.find(1) > > > >and I printed out Priority.table_name to confirm it was still correct. > > > >What gives? Did I screw up the upgrade process? Is there some secret > >bit I need to flip? > > > >-Kate > >(masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org) > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > Isn''t "find" a existing method on one of the core classes... another > post here earlier with similar problem ("View" I think". > > Try to change name of the method > > // JoNtE > >
On Fri, 4 Mar 2005 18:12:42 -0500, kate rhodes <masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m not following you. > find IS one of the core methods. It''s the core method that broke. I > don''t see how putting a wrapper around it would help. I''m not > overriding it or doing anything funky.What version of ruby are you using? IIRC rails 0.10 will break unless you''re using ruby 1.8.2, so make sure you''ve got the latest version of everything. -- One Guy With A Camera http://rbpark.ath.cx
> What version of ruby are you using? IIRC rails 0.10 will break unless > you''re using ruby 1.8.2, so make sure you''ve got the latest version of > everything.I finally found the problem. it wasn''t the ruby version, same results in 1.8.1 and 1.8.2 Turns out the problem was that in those two classes I had the following, which was written so long ago I''d forgotten about it. Apparently this was OK in my last version of Rails but doesn''t pass muster in the current version def self.find_all return find_by_sql "SELECT * from priorities ORDER BY sort_order" end in the 0.10.0 version this has to start with: def self.find_all(conditions = nil, orderings = nil, limit = nil, joins = nil) In case you''re curious the reason I was doing the sort there instead of passing in the ordering, it''s because I never want them unordered or ordered any other way. I was saving myself a little code. -Kate (masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)