Mapping Models to Databases

I know that rails is smart so if I create a model let’s say “Object”, he
will map it to the table pluralization like the table “objects”. But
what happens when I have an obscure table named like ss_gd_objects? How
can I tie it to a model?

You can use the set_table_name directive, e.g. from Agile Rails (pg.

class Order < ActiveRecord::Base
set_table_name “ord_rev99_x” # Wrap a legacy table…

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