Good afternoon,
I am currently migrating an app from rails 2.1 to rails 3 and found a
problem that I realized was due to the fact that the BD columns had
reserved rails names.
I only have read access to BD, so I can’t change the name of columns.
The column in question is called “reference” and I’m having a
very strange behavior during implementation:
-
initializing / creating the object (which maps to the table) on the
console I get the message "ActiveRecord:: DangerousAttributeError:
reference? is defined by ActiveRecord ". I’ve tried a few approaches
(default_scope, override the instance_method_already_implemented?) But
all without success -
running the code through the browser, i don’t get this error, I can
persist the object on the database. When i try and fetch it afterwards,
i get an error when accessing “self.reference”. The strange thing is
that if i put a log entry before that access (with an object inspect) i
don’t get that error anymore…
Thank you so much guys.
Bruno C.