-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Hi, I've found a small problem when setting the bitmask to a list of strings (for example the output from checkbox parameters) and checking the state before a db save.
I can see in ValueProxy value.to_sym is used to convert things back to symbols after its pulled from the db, but if you want to check the status before the db save it looks like its using the original (string) list.
bitmask :disabled, :as => [:delete,:hide]
@user = current_user
puts @user.disabled = [:delete,:hide]
puts @user.disabled?(:hide) #true
puts @user.disabled?(:delete) #true
puts @user.disabled = ["delete","hide"] #eg from checkboxes
puts @user.disabled?(:hide) #false when tested agains symbol
puts @user.disabled?("delete") #true
I'm converting the list to symbols before I set it, but could this be done in the setter?
Metadata
Metadata
Assignees
Labels
No labels