Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Is it ok to rename existing bitmask value? #82

Open
zocoi opened this issue Oct 2, 2018 · 1 comment
Open

Is it ok to rename existing bitmask value? #82

zocoi opened this issue Oct 2, 2018 · 1 comment

Comments

@zocoi
Copy link

zocoi commented Oct 2, 2018

Warning: Modifying possible values
IMPORTANT: Once you have data using a bitmask, don't change the order of the values, remove any values, or insert any new values in the :as array anywhere except at the end. You won't like the results.

The README warns not to change the order of :as array once we have data, but is it ok to rename one value without changing the order?

Example:

class User < ActiveRecord::Base
  bitmask :roles, :as => [:writer, :publisher, :editor, :proofreader]
end

to

class User < ActiveRecord::Base
  bitmask :roles, :as => [:writer, :publisher, :story_editor, :proofreader, :event_editor]
end
@zocoi zocoi changed the title Is it ok to rename existing? Is it ok to rename existing bitmask value? Oct 2, 2018
@zocoi
Copy link
Author

zocoi commented Apr 11, 2019

Just to follow up to this question, we did rename the bitmask role and it works pretty well without breaking

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant