Object.send problem within ActiveRecord

I am using the send method in one of my active records … executing a
method without any parameters works fine… but when it comes to
parameters it says

ArgumentError: wrong number of arguments (1 for 0)

u = User.new
#works
u.send :firstname
#does not work => ArgumentError: wrong number of arguments (1 for 0)
u.send :firstname, ‘michal’

does someone know why? the rubydoc says that its possible to call it
with params also…

On Dec 21, 2007 8:01 AM, Michal G. <
[email protected]> wrote:

#does not work => ArgumentError: wrong number of arguments (1 for 0)
u.send :firstname, ‘michal’

does someone know why? the rubydoc says that its possible to call it
with params also…

Posted via http://www.ruby-forum.com/.


Ryan B.

On 12/20/07, Michal G. [email protected]
wrote:

#does not work => ArgumentError: wrong number of arguments (1 for 0)
u.send :firstname, ‘michal’

u.send ‘firstname=’, ‘michal’

jeremy

p = Party.new
=>

p.send :name
=> nil

Works for me.

Jeremy K. wrote:

On 12/20/07, Michal G. [email protected]
wrote:

#does not work => ArgumentError: wrong number of arguments (1 for 0)
u.send :firstname, ‘michal’

u.send ‘firstname=’, ‘michal’

jeremy

thanks jeremy that was it.