-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
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 => '女性'
endI 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)
Metadata
Metadata
Assignees
Labels
No labels