method

set_table_name

set_table_name(value = nil, &block)
public

Sets the table name to use to the given value, or (if the value is nil or false) to the value returned by the given block.

  class Project < ActiveRecord::Base
    set_table_name "project"
  end

1Note

must be first

dalupus ยท May 24, 20112 thanks

A little gotcha I ran into.

This must be defined before you define your relationships.

ie: class Ticket < ActiveRecord::Base set_table_name 'ticket' belongs_to :customer has_one :account, :through => :customer end

if you do the relationships first it will not use the correct table name on the lookups.