Forum: Ruby on Rails Kernel#send behaving strangely with ActiveRecord attribute methods

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Marcelo de Moraes Serpa (Guest)
on 2012-05-22 04:37
(Received via mailing list)
I'm going through an weird behavior with Kernel#send and *I think* it
be related to ActiveRecord (I'm using Rails 2.3.11).

I have a User model that has the following fields:
  email: String
  status: Integer

(among others)

If I do:

some_arg_that_might_come_in_a_local_var = true
method = 'email'
=> ''

So, email doesn't expect the additional var (it's an AR accessor AFAIK,
it should not accept any args), but it doesn't throw the ArgumentError

The some_arg_that_might_come_in_local_var is an argument that will be
passed to certain methods that DO accept a second boolean argument, but
happens that sometimes the method argument sent to send can be email or

But if I do:
some_arg_that_might_come_in_a_local_var = true

ArgumentError: wrong number of arguments (1 for 0)

I then get the exception.

Any ideas?


- Marcelo.
This topic is locked and can not be replied to.