How do I explicitly specify a Model's table-name mapping in Rails?
Rails >= 3.2 (including Rails 4+ and 5+):
class Countries < ActiveRecord::Base
self.table_name = "cc"
end
Rails <= 3.1:
class Countries < ActiveRecord::Base
self.set_table_name "cc"
...
end
class Countries < ActiveRecord::Base
self.table_name = "cc"
end
In Rails 3.x this is the way to specify the table name.