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

Dynamically-Generating Predicates Methods bug #62

Open
aklein-dex opened this issue Jan 11, 2013 · 0 comments
Open

Dynamically-Generating Predicates Methods bug #62

aklein-dex opened this issue Jan 11, 2013 · 0 comments

Comments

@aklein-dex
Copy link

I think there is a bug with theses predicated methods. Kind of confusion.

In my model:

  enum_attr :gender, %w(^none male female) do
    label :none => ''
    label :male => '男性'
    label :female => '女性'
  end

I set my model gender to :male.
Look at the result in the console:

1.9.3-p0 :018 > s.gender
 => :male 
1.9.3-p0 :019 > s.gender_male?
 => true 
1.9.3-p0 :020 > s.gender_female?
 => true 
1.9.3-p0 :021 > s.gender_none?
 => false 

Why does it return "true" for female ?
Is it because in "female" there is the word "male" so it is confused ?

I'm using:
Using enumerated_attribute (0.3.0.beta1) from https://github.com/jeffp/enumerated_attribute.git (at master)

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