Ruby on Rails: Is it possible to use Camel-cased database field and table names?

前端 未结 3 1686
无人及你
无人及你 2021-01-20 11:20

The Ruby on Rails convention for database table and field names is snake_case and not CamelCase. However, I have an existing database being used by a PHP application. I woul

3条回答
  •  执笔经年
    2021-01-20 11:40

    for the datbases tables name you could use set_table_name

      class Dog < ActiveRecord::Base
        set_table_name 'dog'
      end
    

    for the field you could override your accessor . hope be usefull . bye

提交回复
热议问题