Rails 3 and 4
Did a little digging into the Rails Engine codebase to find a solution.
If you define a method to specify the table name prefix (in /lib/my_engine.rb
), it will just use that instead. So set returning nil works fine.
require "my_engine/engine"
module MyEngine
# Don't have prefix method return anything.
# This will keep Rails Engine from generating all table prefixes with the engines name
def self.table_name_prefix
end
end