{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/rails/issues/21157","labels_url":"https://api.github.com/repos/rails/rails/issues/21157/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/21157/comments","events_url":"https://api.github.com/repos/rails/rails/issues/21157/events","html_url":"https://github.com/rails/rails/issues/21157","id":99596257,"number":21157,"title":"has_many wrong pluralisation with \"f\" and \"v\"","user":{"login":"damoiser","id":1612582,"avatar_url":"https://avatars.githubusercontent.com/u/1612582?v=3","gravatar_id":"","url":"https://api.github.com/users/damoiser","html_url":"https://github.com/damoiser","followers_url":"https://api.github.com/users/damoiser/followers","following_url":"https://api.github.com/users/damoiser/following{/other_user}","gists_url":"https://api.github.com/users/damoiser/gists{/gist_id}","starred_url":"https://api.github.com/users/damoiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damoiser/subscriptions","organizations_url":"https://api.github.com/users/damoiser/orgs","repos_url":"https://api.github.com/users/damoiser/repos","events_url":"https://api.github.com/users/damoiser/events{/privacy}","received_events_url":"https://api.github.com/users/damoiser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-07T07:33:59Z","updated_at":"2015-08-07T07:33:59Z","closed_at":null,"body":"I have discovered a bug when using the ```has_many``` with a name that ends with ```ves```, let me write an example:\r\n\r\nClass definition\r\n```\r\nclass LocalDrive < ActiveRecord::Base\r\nend\r\n\r\nclass Server < ActiveRecord::Base\r\n  has_many :local_drives\r\nend\r\n```\r\n\r\nIn this case, when trying to access to the ```LocalDrive``` model, I receive the following error:\r\n\r\n```\r\nNameError: uninitialized constant Server::LocalDrife\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/inheritance.rb:158:in `compute_type'\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/reflection.rb:271:in `compute_class'\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/reflection.rb:267:in `klass'\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/associations/association.rb:118:in `klass'\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb:41:in `reader'\r\n    /Users/xxx/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.3/lib/active_record/associations/builder/association.rb:115:in `local_drives'\r\n```\r\n\r\nPlease note the change from ```LocalDrive``` to ```LocalDrife```.\r\n\r\nIf I explicitly define the ```class_name``` attribute\r\n\r\n```\r\nclass Server < ActiveRecord::Base\r\n  has_many :local_drives, class_name: \"LocalDrive\"\r\nend\r\n```\r\nThe error disappears, BUT the accessories methods are still wrongs: \r\n\r\n```\r\n% rails c\r\npry(main)> Server.first.local_dri\r\nServer.first.local_drife_ids   Server.first.local_drife_ids=  Server.first.local_drive       Server.first.local_drive=      Server.first.local_drives      Server.first.local_drives=\r\n```\r\n\r\nNote the ```Server.first.local_drife_ids```\r\n\r\n\r\nCode to reproduce: https://gist.github.com/damoiser/a0ef124a5ba1aee78135"}}