I think that for these types of tasks it is always better to create the models by hand, something like:
class NuevoModelo < ActiveRecord::Base
set_table_name "nombreDeTablaRaro"
set_primary_key "IDQueNoSigueConvencionRails"
end
But if you do not want to give it to you, you could try using rmre that uses reverse engineering to generate the models. It has been without maintenance for a long time, but neither has the basic structure of a rails 3 model changed to what is today 5 rails.
After installing the gem with gem install rmre
, you start the process with
rmre -a mysql2 -d basededatos -u usuario -p contraseña -o /ruta/donde/crear/modelos'
Obviously mysql2
can be changed by the adapter you are using for your specific engine.
Anyway, do not trust 100% of what you generate and adapt it to your own needs or naming conventions that you want to use for your models.