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

value can not include dash #22

Open
poc7667 opened this issue Aug 25, 2015 · 1 comment
Open

value can not include dash #22

poc7667 opened this issue Aug 25, 2015 · 1 comment
Labels

Comments

@poc7667
Copy link

poc7667 commented Aug 25, 2015

I defined enum :lang, [:'zh-TW', :jp]

and I got exception.

.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mongoid-enum-0.3.0/lib/mongoid/enum.rb:69:in `class_eval': (eval):1: syntax error, unexpected '-', expecting ';' or '\n'
def zh-TW?() self._lang == :zh-TW end
       ^
(eval):1: syntax error, unexpected keyword_self, expecting end-of-input
def zh-TW?() self._lang == :zh-TW end
                 ^ (SyntaxError)
@thetron thetron added the bug label Aug 25, 2015
@thetron
Copy link
Owner

thetron commented Aug 25, 2015

Ah yes. I can see why that might happen.

Given the way the gem (currently) works - the only way around this would be to use underscored values - but I will definitely include a patch for this in the next release.

Thanks for finding this one! 🍻

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

No branches or pull requests

2 participants