I want to create a model called ‘File’, but it is a reserved model name is rails. I can’t think of anything else sane to call the model, so I was wondering if there is a standard way of dealing with this issue, for example adding a prefix or suffix (_File, FileItem, etc)?
Share
This problem is addressed with modules:
In your case:
whereby your
Fileclass is used asMyRailsApp::File. This is the typical solution in Ruby, in Ruby on Rails this might be handled differently, please see the following references for an in depth discussion: