views:

20

answers:

1

My project doesn't use the plural convention in table's names. How can I override this convention without calling set_table_name in all my ActiveRecord class

+3  A: 

You have to create an initializer in your rails project like this:

# file: config/initializers/active_record_extensions.rb

ActiveRecord::Base.pluralize_table_names = false

This will make all your table names singular by default on your models.

Roman Gonzalez