Regarding Database convention

Hi,

I have a database which have table named with different convention, It
is not following rubyonrails convention that table name must be pural.

How to create model for these table which will not follow convention.

please help me regarding this

Santosh R patil wrote:

Hi,

I have a database which have table named with different convention, It
is not following rubyonrails convention that table name must be pural.

How to create model for these table which will not follow convention.

please help me regarding this

You can create model with script/generate model. Then in model:

class Foobar < ActiveRecord::Base
set_table_name “no_conventional_table_name”
set_primary_key “no_conventional_primary_key_id” # if needed
end

Regards!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs