Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-03 Thread Matt Jones
This will be a pretty rough default for some DBs that have short identifier maximums (Oracle is *30* characters). We’d also need to be explicit about what happens with models that descend from namespaced classes (from an engine, for instance). IIRC, current behavior derives the table name for

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-03 Thread Matthew Dunbar
Suggesting that we can auto generate the prefix based on the module name, rather than setting it with the existing method. Then eventually this feels like a sensible default to me. On Sunday, February 1, 2015 at 7:39:58 AM UTC-5, Carlos Antonio da Silva wrote: Not sure I get what's the

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-03 Thread Carlos Antonio da Silva
The first suggestion, as far as I understood, was related to something like inherits_table_prefix_from_*namespace, *which seems pretty much the same as setting the table name prefix. In any case, I've seen many many cases where people organize their models in namespaces, but the tables might not

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-01 Thread Carlos Antonio da Silva
Not sure I get what's the actual difference between a new option like that and setting the table name prefix on the module, which will work for all classes under it? Can you expand on that a bit? On Sat, Jan 31, 2015 at 4:52 AM, Matthew Dunbar m...@mattdsworld.com wrote: I will implement this

Re: [Rails-core] Generating ActiveRecord model table name to include namespace

2015-02-01 Thread Bráulio Bhavamitra
Check http://apidock.com/rails/ActiveRecord/Base/table_name_prefix/class On Saturday, January 31, 2015, Matthew Dunbar m...@mattdsworld.com wrote: I will implement this myself, looking for feedback on if it'd be accepted and how the community feels about the long term of this being enabled by

[Rails-core] Generating ActiveRecord model table name to include namespace

2015-01-31 Thread Matthew Dunbar
I will implement this myself, looking for feedback on if it'd be accepted and how the community feels about the long term of this being enabled by default. I often run into conflicts between table names when running multiple fairly heavyweight engines that all deal with e-commerce (and in turn