ok, starting to get a tad frustrated. rails ActiveRecord::Base docs... http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000860 ...show the basic use of the find method to be as so: Person.find(1) # returns the object for ID = 1 ...but when i do the exact same method call in my code, i get this error... ArgumentError (wrong number of arguments (2 for 1)) this only started after i upgraded to 1.1.6. what gives? any help appreciated, this basic method failing is doing a great job of holding me up ;) thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ian Van Hoven
2006-Oct-30 16:54 UTC
Re: ArgumentError (wrong number of arguments (2 for 1))
think i figgered it out... "records - a table named records seemed to cause duplicate entries to be found by find" my bad for naming a table Records in my jukebox app :( apologies for the spam. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
post some more of your log so we can see where it''s failing exactly. also, are you using any plugins that modify/extend ActiveRecord? ed On 10/30/06, Ian Van Hoven <ianvanhoven-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > ok, starting to get a tad frustrated. rails ActiveRecord::Base docs... > > http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000860 > > ...show the basic use of the find method to be as so: > > Person.find(1) # returns the object for ID = 1 > > ...but when i do the exact same method call in my code, i get this > error... > > ArgumentError (wrong number of arguments (2 for 1)) > > this only started after i upgraded to 1.1.6. > > what gives? any help appreciated, this basic method failing is doing a > great job of holding me up ;) > > thanks in advance. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Mon, 2006-10-30 at 08:42 -0800, Ian Van Hoven wrote:> ok, starting to get a tad frustrated. rails ActiveRecord::Base docs... > > http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000860 > > ...show the basic use of the find method to be as so: > > Person.find(1) # returns the object for ID = 1 > > ...but when i do the exact same method call in my code, i get this > error... > > ArgumentError (wrong number of arguments (2 for 1)) > > this only started after i upgraded to 1.1.6. > > what gives? any help appreciated, this basic method failing is doing a > great job of holding me up ;)---- I''d say that what is holding you up is not understanding what is happening. (wrong number of arguments (2 for 1) is like doing... Person.find(1, 2) which I think doesn''t work (haven''t tested it) Person.find(:all, :conditions => ["id = ''1'' || id = ''2''"]) should work You might want to show us the actual code. Craig --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---