You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seem to be a problem with the dynamically created methods, when the selected value is a part of one of the other values of the attribute.
A good example is when adding eg. a "sex" enumerated attribute with "female" and "male" values:
class Tractor
enum_attr :driver_sex, %w(male female)
end
These specs both fail:
it "should not fail like this:" do
t = Tractor.new
t.driver_sex = :male
t.driver_sex_female?.should be_false
end
=> Failure/Error: t.driver_sex_female?.should be_false
expected true to be false
it "should not fail like this:" do
t = Tractor.new
t.driver_sex = :female
t.driver_sex_female?.should be_true
end
=> Failure/Error: t.driver_sex_female?.should be_true
expected false to be true
The text was updated successfully, but these errors were encountered:
There seem to be a problem with the dynamically created methods, when the selected value is a part of one of the other values of the attribute.
A good example is when adding eg. a "sex" enumerated attribute with "female" and "male" values:
These specs both fail:
The text was updated successfully, but these errors were encountered: