Obie Fernandez
2006-Jun-29 02:44 UTC
Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
wtf? did I miss a previous discussion on this or something? That''s an ugly hack if I''ve ever seen one. - obie Changes (by bitsweat): * resolution: => wontfix * version: => 1.1.1 * status: new => closed Comment: Pass a block wrapping the default table name to {{{set_table_name}}} {{{ class ActiveRecord::Base set_table_name { @squished_table_name ||= original_table_name.gsub(''_'', '''') } end
Michael Koziarski
2006-Jun-29 19:39 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
I think something like this may be more suitable for acts_as_legacy. There are a myriad of enterprise naming standards (ZX_CST_ID__) and we''ll never support them all. On 6/28/06, Obie Fernandez <obiefernandez@gmail.com> wrote:> wtf? did I miss a previous discussion on this or something? That''s an > ugly hack if I''ve ever seen one. > > - obie > > Changes (by bitsweat): > > * resolution: => wontfix > * version: => 1.1.1 > * status: new => closed > > Comment: > > Pass a block wrapping the default table name to {{{set_table_name}}} > {{{ > class ActiveRecord::Base > set_table_name { @squished_table_name ||= original_table_name.gsub(''_'', > '''') } > end > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >-- Cheers Koz
Obie Fernandez
2006-Jun-29 22:36 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
I think my patch is merited, but if nobody else thinks so then I''ll defer to the wisdom of the group. That said, the workaround provided by bitsweat doesn''t make sense to me. I wonder if perhaps I didn''t get my point across in the description. Oh and I don''t quite understand how it is pleasantly pluggable either. Looks like a total hack to me. Obie On 6/29/06, Michael Koziarski <michael@koziarski.com> wrote:> I think something like this may be more suitable for acts_as_legacy. > There are a myriad of enterprise naming standards (ZX_CST_ID__) and > we''ll never support them all. > > On 6/28/06, Obie Fernandez <obiefernandez@gmail.com> wrote: > > wtf? did I miss a previous discussion on this or something? That''s an > > ugly hack if I''ve ever seen one. > > > > - obie > > > > Changes (by bitsweat): > > > > * resolution: => wontfix > > * version: => 1.1.1 > > * status: new => closed > > > > Comment: > > > > Pass a block wrapping the default table name to {{{set_table_name}}} > > {{{ > > class ActiveRecord::Base > > set_table_name { @squished_table_name ||= original_table_name.gsub(''_'', > > '''') } > > end > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > -- > Cheers > > Koz > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
Charles O Nutter
2006-Jun-29 22:48 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
I would vote for inclusion; I have seen, been taught, read about, and used far more databases with underscore-delimited identifiers than with any other scheme. It is still my preferred table naming scheme and I doubt I''m the only one. You can''t support all schemes, I understand; but underscore-delimited has got to be the #1 or #2 most-used. It is, perhaps, an existing convention that warrants less/easier configuration (not to mention hacking about with default_table_name). Excluding this patch also damages Rails''s ability to easily support the thousands of existing databases with underscore-delimited identifiers (like every single database at my company and every company I''ve ever worked for). I''d say that needlessly hampers Rails''s further adoption into existing development shops. On 6/29/06, Obie Fernandez <obiefernandez@gmail.com> wrote:> > I think my patch is merited, but if nobody else thinks so then I''ll > defer to the wisdom of the group. That said, the workaround provided > by bitsweat doesn''t make sense to me. I wonder if perhaps I didn''t get > my point across in the description. > > Oh and I don''t quite understand how it is pleasantly pluggable either. > Looks like a total hack to me. > > Obie > > On 6/29/06, Michael Koziarski <michael@koziarski.com> wrote: > > I think something like this may be more suitable for acts_as_legacy. > > There are a myriad of enterprise naming standards (ZX_CST_ID__) and > > we''ll never support them all. > > > > On 6/28/06, Obie Fernandez <obiefernandez@gmail.com> wrote: > > > wtf? did I miss a previous discussion on this or something? That''s an > > > ugly hack if I''ve ever seen one. > > > > > > - obie > > > > > > Changes (by bitsweat): > > > > > > * resolution: => wontfix > > > * version: => 1.1.1 > > > * status: new => closed > > > > > > Comment: > > > > > > Pass a block wrapping the default table name to {{{set_table_name}}} > > > {{{ > > > class ActiveRecord::Base > > > set_table_name { @squished_table_name ||> original_table_name.gsub(''_'', > > > '''') } > > > end > > > _______________________________________________ > > > Rails-core mailing list > > > Rails-core@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > > > > > -- > > Cheers > > > > Koz > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >-- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ www.jruby.org Application Architect @ www.ventera.com _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Jeremy Kemper
2006-Jun-29 23:28 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
On Jun 29, 2006, at 3:36 PM, Obie Fernandez wrote:> I think my patch is merited, but if nobody else thinks so then I''ll > defer to the wisdom of the group. That said, the workaround provided > by bitsweat doesn''t make sense to me. I wonder if perhaps I didn''t get > my point across in the description. > > Oh and I don''t quite understand how it is pleasantly pluggable either. > Looks like a total hack to me.It''s not a total hack workaround, it''s a feature! Passing a block to set_table_name is an ugly dog (the cache var doesn''t help) but it''s there so you can transform the default table name as you like. A plugin is natural considering the usage you want is uncommon and covered by the public API. jeremy
Obie Fernandez
2006-Jun-30 00:08 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
Okay it really isn''t common enough to justify argument. No hard feelings. Thanks, Obie On 6/29/06, Jeremy Kemper <jeremy@bitsweat.net> wrote:> On Jun 29, 2006, at 3:36 PM, Obie Fernandez wrote: > > I think my patch is merited, but if nobody else thinks so then I''ll > > defer to the wisdom of the group. That said, the workaround provided > > by bitsweat doesn''t make sense to me. I wonder if perhaps I didn''t get > > my point across in the description. > > > > Oh and I don''t quite understand how it is pleasantly pluggable either. > > Looks like a total hack to me. > > It''s not a total hack workaround, it''s a feature! Passing a block to > set_table_name is an ugly dog (the cache var doesn''t help) but it''s > there so you can transform the default table name as you like. A > plugin is natural considering the usage you want is uncommon and > covered by the public API. > > jeremy > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
Charles O Nutter
2006-Jun-30 00:20 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
n/m, I got the purpose of this reversed... On 6/29/06, Charles O Nutter <headius@headius.com> wrote:> > I would vote for inclusion; I have seen, been taught, read about, and used > far more databases with underscore-delimited identifiers than with any other > scheme. It is still my preferred table naming scheme and I doubt I''m the > only one. You can''t support all schemes, I understand; but > underscore-delimited has got to be the #1 or #2 most-used. It is, perhaps, > an existing convention that warrants less/easier configuration (not to > mention hacking about with default_table_name). > > Excluding this patch also damages Rails''s ability to easily support the > thousands of existing databases with underscore-delimited identifiers (like > every single database at my company and every company I''ve ever worked for). > I''d say that needlessly hampers Rails''s further adoption into existing > development shops. > > > On 6/29/06, Obie Fernandez <obiefernandez@gmail.com> wrote: > > > > I think my patch is merited, but if nobody else thinks so then I''ll > > defer to the wisdom of the group. That said, the workaround provided > > by bitsweat doesn''t make sense to me. I wonder if perhaps I didn''t get > > my point across in the description. > > > > Oh and I don''t quite understand how it is pleasantly pluggable either. > > Looks like a total hack to me. > > > > Obie > > > > On 6/29/06, Michael Koziarski <michael@koziarski.com > wrote: > > > I think something like this may be more suitable for acts_as_legacy. > > > There are a myriad of enterprise naming standards (ZX_CST_ID__) and > > > we''ll never support them all. > > > > > > On 6/28/06, Obie Fernandez < obiefernandez@gmail.com> wrote: > > > > wtf? did I miss a previous discussion on this or something? That''s > > an > > > > ugly hack if I''ve ever seen one. > > > > > > > > - obie > > > > > > > > Changes (by bitsweat): > > > > > > > > * resolution: => wontfix > > > > * version: => 1.1.1 > > > > * status: new => closed > > > > > > > > Comment: > > > > > > > > Pass a block wrapping the default table name to > > {{{set_table_name}}} > > > > {{{ > > > > class ActiveRecord::Base > > > > set_table_name { @squished_table_name ||> > original_table_name.gsub(''_'', > > > > '''') } > > > > end > > > > _______________________________________________ > > > > Rails-core mailing list > > > > Rails-core@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > > > > > > > > > -- > > > Cheers > > > > > > Koz > > > _______________________________________________ > > > Rails-core mailing list > > > Rails-core@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > > -- > Charles Oliver Nutter @ headius.blogspot.com > JRuby Developer @ www.jruby.org > Application Architect @ www.ventera.com >-- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ www.jruby.org Application Architect @ www.ventera.com _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Rob Sanheim
2006-Jun-30 04:58 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
On 6/29/06, Charles O Nutter <headius@headius.com> wrote:> n/m, I got the purpose of this reversed... > >[whole thread snipped] The larger (and worst) issue with set_table_name is that it breaks transactional fixtures and forces you to use instantiated fixtures...but I suppose thats a whole ''nother thread. - Rob
Rick Olson
2006-Jul-03 15:21 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
fixtures map to table names. Use set_fixture_class to set a custom class name for a fixture name. -- Rick Olson http://techno-weenie.net
Rob Sanheim
2006-Jul-05 23:52 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
On 7/3/06, Rick Olson <technoweenie@gmail.com> wrote:> fixtures map to table names. Use set_fixture_class to set a custom > class name for a fixture name. > > > -- > Rick Olson > http://techno-weenie.netIs there any reason there is no documentation for this? Or just awaiting a patch? - Rob -- http://www.robsanheim.com http://www.seekingalpha.com http://www.ajaxian.com
Kevin Clark
2006-Jul-06 00:38 UTC
Re: Re: [Ruby on Rails] #5544: [PATCH] Add underscore_table_names option to ActiveRecord::Base
This is my fault. set_fixture_class was something I contributed to fix the bug, but didn''t write RDoc for it at the time. If you want to file a ticket for it (make sure to add the ''docs'' keyword) then I''ll get on it. Kev On 7/5/06, Rob Sanheim <rsanheim@gmail.com> wrote:> On 7/3/06, Rick Olson <technoweenie@gmail.com> wrote: > > fixtures map to table names. Use set_fixture_class to set a custom > > class name for a fixture name. > > > > > > -- > > Rick Olson > > http://techno-weenie.net > > > Is there any reason there is no documentation for this? Or just > awaiting a patch? > > - Rob > -- > http://www.robsanheim.com > http://www.seekingalpha.com > http://www.ajaxian.com > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >-- Kevin Clark http://glu.ttono.us