David Kahn
2011-May-07 19:35 UTC
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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2011-May-07 19:45 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On 7 May 2011 20:35, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> 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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2011-May-07 19:47 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On 7 May 2011 20:35, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> 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)"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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-May-07 19:51 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On 7 May 2011, at 20:35, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> 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> > 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. > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2011-May-07 19:56 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On Sat, May 7, 2011 at 2:51 PM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 7 May 2011, at 20:35, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote: > > 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.> > Fred > > > 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. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2011-May-07 20:00 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On 7 May 2011 20:56, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> > > On Sat, May 7, 2011 at 2:51 PM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> On 7 May 2011, at 20:35, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote: >> >> 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"Datum is the singular, one datum. Data is the plural, lots of data. So datum.pluralize is data, data.singularize is datum. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2011-May-07 20:03 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On 7 May 2011 20:56, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote:> I agree I should be using ''datum'' for the plural formSingular. "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" -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2011-May-07 20:48 UTC
Re: Inflection working everywhere but not propogating to AR table name?
On Sat, May 7, 2011 at 3:03 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7 May 2011 20:56, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org> wrote: > > 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....> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.