I have a Model class called Countries and I want it to map to a DB table called 'cc'.
How is that done in Rails?
Join Stack Overflow to learn, share knowledge, and build your career.
I have a Model class called Countries and I want it to map to a DB table called 'cc'.
How is that done in Rails?
class Countries < ActiveRecord::Base
self.table_name = "cc"
end
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.