Is Rails intelligent to know that plurals do not necessarily entail adding an s?
I have a model named Matrix with a corresponding table, matrices. Rails 5 cannot connect my model to its rightful table. Using Matrice instead of Matrix seems to be working.
Kinnell Shah
Senior Software Engineer @ Veracross
Yes, it is.
Rails defines pluralization rules within ActiveSupport. You can see the rules defined here: github.com/rails/rails/blob/master/activesupport/…
The plural form of "matrix" is defined as "matrices". You can verify this by running
"Matrix".tableize"in Rails console which will return"matrices".I'm not completely certain about this, but "Matrix" may actually be a reserved class name in Rails as there exists a ruby class called Matrix.