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
I am using state_machine with the enum_column3 gem.
It seems, that the enum_column3 gem sets the attribute values in the model instance to symbols, rather than strings
using either @value = options.include?(:value) ? options[:value] : name
or
matcher ? matcher.call(other_value) : other_value.to_s == value.to_s
would fix the problem.
I know, that probably using e.g. "state :active, :value => :active" could work, but rather would like to avoid doing that, since I would have to fix many places, and I think that the gem should be more specific about it, since the "can_{status}{namespace}?" works, but not the "{namespace}{status}?" helper.
Let me know, what you think.
Thanks
The text was updated successfully, but these errors were encountered:
Hi, great plugin, thanks.
I am using state_machine with the enum_column3 gem.
It seems, that the enum_column3 gem sets the attribute values in the model instance to symbols, rather than strings
code:
status_active? and can_inactive_status? should be true in this example, but only the "can" helper is:
The code responsible for this is
using either
@value = options.include?(:value) ? options[:value] : name
or
matcher ? matcher.call(other_value) : other_value.to_s == value.to_s
would fix the problem.
I know, that probably using e.g. "state :active, :value => :active" could work, but rather would like to avoid doing that, since I would have to fix many places, and I think that the gem should be more specific about it, since the "can_{status}{namespace}?" works, but not the "{namespace}{status}?" helper.
Let me know, what you think.
Thanks
The text was updated successfully, but these errors were encountered: