Inflection working everywhere but not propogating to AR table name?

I added this rule to inflections:

inflect.uncountable ‘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 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.

"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.

Colin

I added this rule to inflections:

inflect.uncountable ‘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?

Fred

I added this rule to inflections:

inflect.uncountable ‘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?

I agree I should be using ‘datum’ for the plural form although I dont think that word have ever passed my lips. That aside, what is strange is this:

(rdb:1) “auth_data”.pluralize “auth_datas” (rdb:1) “auth_data”.singularize “auth_datum” (rdb:1) “data”.pluralize “datas” (rdb:1) “data”.singularize

“datum”

So it seems things are reversed. The above is run with no inflection set by me.

Datum is the singular, one datum. Data is the plural, lots of data. So datum.pluralize is data, data.singularize is datum.

Colin

I agree I should be using 'datum' for the plural form

Singular.

"datum" is singular, "data" is plural

That aside, what is strange is ... it seems things are reversed.

Nothing is strange when you're inflecting the right way round:

"auth_data".singularize

=> "auth_datum"

"auth_datum".pluralize

=> "auth_data"

I agree I should be using ‘datum’ for the plural form

Singular.

“datum” is singular, “data” is plural

That aside, what is strange is … it seems things are reversed.

Nothing is strange when you’re inflecting the right way round:

“auth_data”.singularize

=> “auth_datum”

“auth_datum”.pluralize

=> “auth_data”

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…