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 many have tables such as most recently payments that conflict). The current solution is to manually specify the table prefix in the appropriate gem / module.
I am suggesting that we add a inherits_prefix_from_namespace flag to models, then eventually in the long term (perhaps rails 5) defaulting this to be enabled.
Ideally this would work as follows:
module Example
module Widgets
class Test < ActiveRecord::Base
inherits_table_prefix_from_namespace: true
end
end
end
Rather than having its table name be
tests , the table name would be
example_widgets_tests.
In the case that a prefix is specified, the table name would be prefix_example_widgets_tests (rather than prefix_tests).