bitmask_attributes icon indicating copy to clipboard operation
bitmask_attributes copied to clipboard

Simple bitmask attribute support for ActiveRecord 3+

Results 20 bitmask_attributes issues
Sort by recently updated
recently updated
newest added

Expected behavior: `rake db:create` runs as normal Actual behavior: ``` rake db:drop rake aborted! ActiveRecord::NoDatabaseError: FATAL: database "foo_development" does not exist /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:688:in `rescue in connect' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:683:in `connect' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:215:in `initialize' /usr/local/rvm/gems/ruby-2.4.4/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:40:in...

I'm upgrading from Rails 5.1 to 5.2 with Active Record now at 5.2.3. I'm using bitmask 1.0. I'm just trying to do a db:create and I get the below error....

> 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...

Just like an enum, if I use an Integer to set the value it should work rather than throwing an error

Hello, It seems that this project uses Fixnum comparisions which are deprecated in ruby >=2.4: https://github.com/joelmoss/bitmask_attributes/search?utf8=%E2%9C%93&q=Fixnum Which causes a lot of deprecation warnings in rspec tests using newer ruby versions....

Hello. Thank a lot for such a precious gem! Do I need to perform some migration to start adding roles? ``` rails -v >Rails 5.0.4 ``` ``` 2.3.3 :001 >...

I might be missing a method that may already be available but what I do now to get a humanized version of an attribute (in the view for example) is...

Unlike normal attributes, unsaved bitmask attributes are not reset when an object is reloaded. This was very surprising to me! ``` ruby def test_bitmask_attributes_reload user = User.create(:name => "Bruce", :roles...

I've found it helpful to define some convenience methods so that I can call things like `user.editor?` instead of `user.roles?(:editor)` for checking a single role. It just makes the interface...

Clarifies the fact that you have to call `model.save` after making changes to commit them to the DB. Also adds example of deleting values. I've done this because we've used...