Skip to content
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

Should raise a warning/error or something when methods already exist #4

Open
thornomad opened this issue Sep 13, 2020 · 1 comment
Open

Comments

@thornomad
Copy link
Contributor

class MyClass < ApplicationRecord
  def blue?
    'blue!'
  end

  enumbled_to :color
end

my = MyClass.new(color: Color.blue)
my.blue? #=> true (not "blue!")

The Enumbler will just silently overwrite a method that is already defined. Rails has a nice way of warning you when it is overwriting a method. We should do the same.

@thornomad
Copy link
Contributor Author

thornomad commented Dec 14, 2020

This was partially fixed by #7 (which addressed an enabled model). This needs to be extended to work with enumbled_to models.

@thornomad thornomad reopened this Dec 14, 2020
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

1 participant