-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
add self.
to allow method name using ruby keyword
#4785
add self.
to allow method name using ruby keyword
#4785
Conversation
Can we add a test for at least 1 of those keywords? |
Is not enough to just prepend self always instead of checking against RUBY_KEYWORDS ? |
Yeah, probably :P |
@ayamomiji please do it and squash your commits :) |
But i cannot just prepend
|
i'll use |
What's happening here? :) |
Is this still an issue? |
/cc @josevalim I don't see another way of doing this but I don't like it neither :/. Or we leave the Ruby keywords list or we remove the CALL_COMPILABLE_REGEXP optimization and always do send(:'#{send}', #{extra}) |
+1 for always do |
👎 I think this is just hacky. :( If they are reserved, we shouldn't be messing with it. We should do make behavior as predictable as possible. In other languages, users have to respect the reserved words. I think we should too. Just my $0.02 |
@isaacsanders disagree, you can define a method called begin for your classes in pure Ruby. So why stopping people for doing that on AM attributes? |
I don't know. It is just my opinion. I feel bad that I can't vocalize why I feel the way I do. |
@isaacsanders no worries :), I was giving my opinion too ❤️ ❤️ ❤️ |
@spastorino @josevalim are we good to go here? :) |
@carlosantoniodasilva read my comment where I've /cced to @josevalim, let's wait for him |
We should just use https://gist.github.com/2686886 Can you please update accordingly? |
column that named as a ruby keyword
@josevalim are we good to go now? :) |
…-using-ruby-keyword add `self.` to allow method name using ruby keyword
fix
alias_attribute
will raise a syntax error if aliasing a column named as a ruby keyword.