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

Easier way to get label #25

Closed
timster opened this issue Jun 24, 2011 · 1 comment
Closed

Easier way to get label #25

timster opened this issue Jun 24, 2011 · 1 comment
Labels

Comments

@timster
Copy link

timster commented Jun 24, 2011

This is more of a question than an issue. I'm just wondering if there is a more convenient way of getting the label for an enum?

Lets say I have an enum_attr called "visibility" on the Post model. Right now I'm doing this:

p = Post.find(1)
p.enums(:visibility).label(p.visibility)

Is there an easier way?

@tinynumbers
Copy link
Collaborator

p.visibilities.label(p.visibility)

(...though I don't know that this is any better.)

#47 also discusses the difficulty of getting the label for an enumeration value.

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