If you implement the class method tablenameprefix inside a regular module:
module Invoice def self.table_name_prefix 'invoice_' end end
Then any models you nest inside that module will prepend that prefix onto their table name:
module Invoice class Customer < ActiveRecord::Base end end Invoice::Customer.table_name # => "invoice_customers"
This is an easy and straightforward way to namespaces models in both your database and application.