It would be nice if there was an option to disable the pluralization in the heuristic used to map Ruby class names to database table names. This can be undesirable:
This seem to be enough:
def (ActiveRecord::Base).table_name
name # or whatever transformation you want.
end
for c in [MyClass,Other,Other2]
def c.table_name
name #or whatever
end
end
Alternatively, you can turn it all off at once using this code:
ActiveRecord::Base.pluralize_table_names = false
You can also specify an irregular pluralisation, allowing specific naming conventions, eg
Inflector.inflections do |inflect|
inflect.irregular ‘taxon’, ‘taxa’
end
However, I have found no way of allowing tables to be named “databases” or “references” – I had to rename them to get the script\generate scaffold to work.