My table name use to be AuthDatas and I want it to be AuthData. I
migrated
the db to change the table name and verified in the debugger that in
fact
“data”.singularize and “data”.pluralize == ‘data’.
But when I go to load the model:
AuthData
I get the error “AuthData(Table doesn’t exist)”
Am I confused or is something not right? The reason I made the change
was
to make the table name pretty! No other reason.
Am I confused or is something not right? The reason I made the change was
to make the table name pretty! No other reason.
“data”.singularize gives me “datum” - which is what it is. Can’t you
change your model to the correct name “AuthDatum”? Then everything
would work as expected.
Is that exactly the error you get? Does it not tell you what table
name it is looking for?
The table name should be auth_data if your inflection is working, or
auth_datas if not. You can always use set_table_name if you want to
override the default. Generally life is much simpler if you just
stick to the conventions.
Strictly of course I think the class should be AuthDatum and the table
name auth_data.
My table name use to be AuthDatas and I want it to be AuthData. I migrated the
db to change the table name and verified in the debugger that in fact
“data”.singularize and “data”.pluralize == ‘data’.
But does it singularize/pluralize auth_data correctly?
Thanks Michael and Colin… yeah, so I named the model wrong as datam
was
not in my vocabulary. Now everything works right. I’ll add it to my
debug
checklist to make sure I know the singualar and plurals of the words…