How to match a non-standard table with ActiveRecord or use another ORM?

I use a tool (UltraSms) that requires three tables named (smsin, smsout and smsparts)

I need these tables to be used in the same Rails application that has other tables. With ActiveRecrod, I know that table names must be plural by the name of the Active record class by convention. Is there a way to easily map them to an ActiveRecrod class, or should I find a manual way to do ORM for it?

Thanks,

There

+5
source share
2 answers

You can do it:

class MyClass < ActiveRecord::Base
  set_table_name "smsin"
end
+7
source

It seems that in Rails3.1 the method name has changed to table_name=, for example.

class Mouse < ActiveRecord::Base
  self.table_name = "mice"
end
+12

All Articles