ActiveRecord private method called


#1

Ok so i just upgraded to rails 2.2.2 and now i’m getting error
“Attempt to call private method”. I found out that this is because my
planet model has attribute named y, which seems is a private attribute
in ActiveRecord::Base. I guess rails didn’t check if it overwrites
private methods before and now it does. Problem is that i have so many
calls to this attribute that changing name is not really an option. I
was thinking about introducing public methods for it, but thought it
might break some ActiveRecord internals. Maybe someone knows any other
option?


#2

On Dec 14, 11:54 pm, Andrius C. removed_email_address@domain.invalid
wrote:

Ok so i just upgraded to rails 2.2.2 and now i’m getting error
“Attempt to call private method”. I found out that this is because my
planet model has attribute named y, which seems is a private attribute
in ActiveRecord::Base. I guess rails didn’t check if it overwrites
private methods before and now it does. Problem is that i have so many
calls to this attribute that changing name is not really an option. I
Well I would still think that’s the best option (and y is hardly a
describle option name)
was thinking about introducing public methods for it, but thought it
might break some ActiveRecord internals. Maybe someone knows any other
option?
You could try sticking
ActiveRecord::Base.send :undef_method, :y

in an initializer.