class ActiveRecord::Migration

def proper_table_name(name, options = {})

options passed in.
Uses the Active Record object's own table_name, or pre/suffix from the
Finds the correct table name given an Active Record object.
def proper_table_name(name, options = {})
  if name.respond_to? :table_name
    name.table_name
  else
    "#{options[:table_name_prefix]}#{name}#{options[:table_name_suffix]}"
  end
end