{"action":"closed","issue":{"url":"https://api.github.com/repos/plataformatec/devise/issues/4969","repository_url":"https://api.github.com/repos/plataformatec/devise","labels_url":"https://api.github.com/repos/plataformatec/devise/issues/4969/labels{/name}","comments_url":"https://api.github.com/repos/plataformatec/devise/issues/4969/comments","events_url":"https://api.github.com/repos/plataformatec/devise/issues/4969/events","html_url":"https://github.com/plataformatec/devise/issues/4969","id":380183133,"node_id":"MDU6SXNzdWUzODAxODMxMzM=","number":4969,"title":"Devise picks up the wrong singular name of resource","user":{"login":"openscript","id":1105080,"node_id":"MDQ6VXNlcjExMDUwODA=","avatar_url":"https://avatars0.githubusercontent.com/u/1105080?v=4","gravatar_id":"","url":"https://api.github.com/users/openscript","html_url":"https://github.com/openscript","followers_url":"https://api.github.com/users/openscript/followers","following_url":"https://api.github.com/users/openscript/following{/other_user}","gists_url":"https://api.github.com/users/openscript/gists{/gist_id}","starred_url":"https://api.github.com/users/openscript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openscript/subscriptions","organizations_url":"https://api.github.com/users/openscript/orgs","repos_url":"https://api.github.com/users/openscript/repos","events_url":"https://api.github.com/users/openscript/events{/privacy}","received_events_url":"https://api.github.com/users/openscript/received_events","type":"User","site_admin":false},"labels":[{"id":962484629,"node_id":"MDU6TGFiZWw5NjI0ODQ2Mjk=","url":"https://api.github.com/repos/plataformatec/devise/labels/Needs%20debugging","name":"Needs debugging","color":"a08ae2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-13T11:34:31Z","updated_at":"2018-11-22T21:54:43Z","closed_at":"2018-11-22T21:54:43Z","author_association":"NONE","body":"Dear devise community\r\n\r\n## Pre-check\r\n\r\n- Do not use the issues tracker for help or support, try Stack Overflow. ✔\r\n- For bugs, do a quick search and make sure the bug has not yet been reported ✔\r\n- Finally, be nice and have fun! ✔✔✔\r\n\r\n## Environment\r\n\r\n- Ruby **2.5.3**\r\n- Rails **5.2.1**\r\n- Devise **4.5.0**\r\n\r\n## Current behavior\r\n\r\nI've the following routes:\r\n\r\n```\r\nRails.application.routes.draw do\r\n  namespace :api do\r\n    devise_for :users\r\n  end\r\n\r\n  [...]\r\nend\r\n```\r\nIn this case Devise picks up the wrong singular name for the resource `users`. It should be `user` instead of `api_user`. This is handed of to `warden`, which fails doing the authentication.\r\n\r\n## Expected behavior\r\nThe problem can be fixed with the parameter `singular` like this:\r\n\r\n```\r\nRails.application.routes.draw do\r\n  namespace :api do\r\n    devise_for :users, singular: :user\r\n  end\r\n\r\n  [...]\r\nend\r\n```\r\n\r\nIs this the way to go? It's probably a bit more intuitive if we pick up the correct singular name."}}
{"actor":{"display_login":"tegon"}}