Skip to content

duplicate method - resource_class #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chirag7jain opened this issue Nov 5, 2015 · 5 comments
Closed

duplicate method - resource_class #433

chirag7jain opened this issue Nov 5, 2015 · 5 comments

Comments

@chirag7jain
Copy link

Why is this method written twice - SetUserByToken concern & Application Controller

def resource_class(m=nil)
  if m
      mapping = Devise.mappings[m]
  else
    mapping = Devise.mappings[resource_name] || Devise.mappings.values.first
  end

  mapping.to
end

since SetUserByToken is included in application_controller, it automatically gets a copy of the method
and we can remove this method from application_controller

@chirag7jain chirag7jain changed the title duplicate method duplicate method - resource_class Nov 5, 2015
@booleanbetrayal
Copy link
Collaborator

Sounds good to me. Would you like to put together a PR @chirag7jain ?

@chirag7jain
Copy link
Author

Yup ... Will do that

On Fri, Nov 6, 2015, 23:58 Brent [email protected] wrote:

Sounds good to me. Would you like to put together a PR @chirag7jain
https://github.com/chirag7jain ?


Reply to this email directly or view it on GitHub
#433 (comment)
.

@booleanbetrayal
Copy link
Collaborator

thanks!

@chirag7jain
Copy link
Author

pull request #435

@zachfeldman
Copy link
Contributor

PR was closed a while ago, going to close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants