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

Rename the enum_prefix and enum_suffix options to _prefix and _suffix #20999

Merged
merged 1 commit into from Jul 23, 2015

Conversation

Projects
None yet
3 participants
@robin850
Member

robin850 commented Jul 23, 2015

Hello,

This pull request renames the enum_{prefix_suffix} options to _{prefix_suffix} in order to make it more clear that they are reserved keywords and also it seems less redundant as the line already starts with the call to the enum method.

Cross-refs #19813 (comment).

Have a nice day.

Rename the enum_{prefix,suffix} options to _{prefix,suffix}
This makes it more clear that they are reserved keywords and also it
seems less redundant as the line already starts with the call to the
`enum` method.

kaspth added a commit that referenced this pull request Jul 23, 2015

Merge pull request #20999 from robin850/enum-prefix-suffix
Rename the enum_prefix and enum_suffix options to _prefix and _suffix

@kaspth kaspth merged commit 2028b57 into rails:master Jul 23, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Jul 23, 2015

Member

Sweet, thanks! Have a nice day too 😄

Member

kaspth commented Jul 23, 2015

Sweet, thanks! Have a nice day too 😄

@robin850 robin850 deleted the robin850:enum-prefix-suffix branch Jul 23, 2015

@robin850

This comment has been minimized.

Show comment
Hide comment
@robin850

robin850 Jul 23, 2015

Member

Thanks! :-)

Member

robin850 commented Jul 23, 2015

Thanks! :-)

# Note that <tt>:enum_prefix</tt>/<tt>:enum_suffix</tt> are reserved keywords
# and can not be used as an enum name.
# Note that <tt>:_prefix</tt>/<tt>:_suffix</tt> are reserved keywords and can
# not be used as enum names.

This comment has been minimized.

@chancancode

chancancode Jul 23, 2015

Member

We can probably ✂️ now? Seems unlikely that people would try to use _ names, so while it's technically still true, it is just adding noise to me. What do you think?

Would trade that with an example of the feature. It doesn't really explain what the feature does, if you didn't know about the history here it seems unlikely that you would understand what it does/why you would need it from reading the docs here

@chancancode

chancancode Jul 23, 2015

Member

We can probably ✂️ now? Seems unlikely that people would try to use _ names, so while it's technically still true, it is just adding noise to me. What do you think?

Would trade that with an example of the feature. It doesn't really explain what the feature does, if you didn't know about the history here it seems unlikely that you would understand what it does/why you would need it from reading the docs here

This comment has been minimized.

@chancancode

chancancode Jul 23, 2015

Member

to define multiple enums with same values

would be nice if the examples actually show that use case 😄

@chancancode

chancancode Jul 23, 2015

Member

to define multiple enums with same values

would be nice if the examples actually show that use case 😄

This comment has been minimized.

@robin850

robin850 Jul 23, 2015

Member

Yes, you're totally right! 👍 Will send a patch then!

@robin850

robin850 Jul 23, 2015

Member

Yes, you're totally right! 👍 Will send a patch then!

robin850 added a commit that referenced this pull request Jul 23, 2015

Improvements on the enum documentation [ci skip]
The note regarding the `_prefix` and `_suffix` options is no longer
useful since they were renamed specifically for this purpose.

Also the given example doesn't show what these options enable and in
which case they are really useful (when there are conflicting values
for instance).

Refs #20999.

[Godfrey Chan & Robin Dupret]

y-yagi added a commit to y-yagi/rails that referenced this pull request May 29, 2016

rename enum_prefix and enum_suffix options to _prefix and _suffix [ci…
… skip]

`:enum_prefix` and `:enum_suffix` was changed to `:_prefix` and `:_suffix`
in #20999.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment