I want to create a rails’ model like FileURL without having to name the file file_u_r_l.rb. How does one go about doing something like this? I understand that you can set table name explicitly but how does one override the default filename to classname mapping?
Thanks
Prateek
You don’t need to do anything. Rails’ .underscore method translates ‘FileURL’ to ‘file_url’, and will look for a file with the same base name in the load path.
If ActiveRecord does not guess the correct table name, use set_table_name: