Andrew Havens
2012-Aug-30 21:59 UTC
Feature Request: Provide documentation and/or feature to configure active record naming conventions
Using Rails on a new app is great because you can stick to the default snake_case database naming scheme. Unfortunately for many, we are trying to progressively switch our applications to using Rails by routing certain requests through our Rails app. Some of the hurdles involve legacy database naming schemes. Our database uses CamelCasenaming schemes. If I could create an initializer that could configure the naming scheme, that would improve the ease-of-transition and make it so the scaffolding generators would respect this custom naming scheme. I am having a hard time tracking down documentation on configuring these types of things so some clear documentation and possibly additional features would go a long way. If this feature exists, could you link me to some documentation. And if no documentation exists, can you help me write it? Thanks, Andrew -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/MmoKyAafl-MJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
dburry
2012-Aug-31 00:42 UTC
Re: Feature Request: Provide documentation and/or feature to configure active record naming conventions
So far I''ve just manually used set_table_name and set_primary_key and similar things in models that must access legacy database tables. It''s worked well with camel case for me so far. Scaffolding models can only get you so far, most of the time I don''t even bother with it anymore since it only saves me typing a couple lines anyway. Dave On Thursday, August 30, 2012 2:59:46 PM UTC-7, Andrew Havens wrote:> > Using Rails on a new app is great because you can stick to the default > snake_case database naming scheme. Unfortunately for many, we are trying > to progressively switch our applications to using Rails by routing certain > requests through our Rails app. Some of the hurdles involve legacy database > naming schemes. Our database uses CamelCasenaming schemes. If I could > create an initializer that could configure the naming scheme, that would > improve the ease-of-transition and make it so the scaffolding generators > would respect this custom naming scheme. I am having a hard time tracking > down documentation on configuring these types of things so some clear > documentation and possibly additional features would go a long way. > > If this feature exists, could you link me to some documentation. And if no > documentation exists, can you help me write it? > > Thanks, > Andrew >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/raoauAyYCswJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anthony Richardson
2012-Aug-31 00:47 UTC
Re: Re: Feature Request: Provide documentation and/or feature to configure active record naming conventions
Same process here. We have a system that uses dozens of tables and views from PeopleSoft. We just use set_table_name and set_primary_key and never use the generators (don''t see much value in them myself). Cheers, Anthony On Fri, Aug 31, 2012 at 10:12 AM, dburry <david.burry@gmail.com> wrote:> So far I''ve just manually used set_table_name and set_primary_key and > similar things in models that must access legacy database tables. It''s > worked well with camel case for me so far. Scaffolding models can only get > you so far, most of the time I don''t even bother with it anymore since it > only saves me typing a couple lines anyway. > > Dave > > > On Thursday, August 30, 2012 2:59:46 PM UTC-7, Andrew Havens wrote: >> >> Using Rails on a new app is great because you can stick to the default >> snake_case database naming scheme. Unfortunately for many, we are trying >> to progressively switch our applications to using Rails by routing certain >> requests through our Rails app. Some of the hurdles involve legacy database >> naming schemes. Our database uses CamelCasenaming schemes. If I could >> create an initializer that could configure the naming scheme, that would >> improve the ease-of-transition and make it so the scaffolding generators >> would respect this custom naming scheme. I am having a hard time tracking >> down documentation on configuring these types of things so some clear >> documentation and possibly additional features would go a long way. >> >> If this feature exists, could you link me to some documentation. And if >> no documentation exists, can you help me write it? >> >> Thanks, >> Andrew >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/raoauAyYCswJ. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Godfrey Chan
2012-Aug-31 02:02 UTC
Re: Re: Feature Request: Provide documentation and/or feature to configure active record naming conventions
You should look into ActiveModel::Naming. You might be able to override certain methods to return a custom subclass of ActiveSupport::Name to do what you want. YMMV Godfrey Sent from my phone On 2012-08-30, at 5:47 PM, Anthony Richardson <richo990@gmail.com> wrote:> Same process here. We have a system that uses dozens of tables and views from PeopleSoft. We just use set_table_name and set_primary_key and never use the generators (don''t see much value in them myself). > > Cheers, > > Anthony > > > On Fri, Aug 31, 2012 at 10:12 AM, dburry <david.burry@gmail.com> wrote: >> So far I''ve just manually used set_table_name and set_primary_key and similar things in models that must access legacy database tables. It''s worked well with camel case for me so far. Scaffolding models can only get you so far, most of the time I don''t even bother with it anymore since it only saves me typing a couple lines anyway. >> >> Dave >> >> >> On Thursday, August 30, 2012 2:59:46 PM UTC-7, Andrew Havens wrote: >>> >>> Using Rails on a new app is great because you can stick to the default snake_case database naming scheme. Unfortunately for many, we are trying to progressively switch our applications to using Rails by routing certain requests through our Rails app. Some of the hurdles involve legacy database naming schemes. Our database uses CamelCasenaming schemes. If I could create an initializer that could configure the naming scheme, that would improve the ease-of-transition and make it so the scaffolding generators would respect this custom naming scheme. I am having a hard time tracking down documentation on configuring these types of things so some clear documentation and possibly additional features would go a long way. >>> >>> If this feature exists, could you link me to some documentation. And if no documentation exists, can you help me write it? >>> >>> Thanks, >>> Andrew >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. >> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/raoauAyYCswJ. >> >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.