README.md in simple_flaggable_column-0.0.3 vs README.md in simple_flaggable_column-0.1.0
- old
+ new
@@ -52,9 +52,41 @@
# => "101"
```
Push/Pop and other arrays operations won't work, just simple writing and reading.
+### :throw_on_missing
+
+If you try to set a non-existing flag it will throw an ArgumentError
+
+```ruby
+game = Game.new
+game.platforms = [:potato]
+# => <ArgumentError: Flag potato doesn't exists>
+```
+
+To disable this and silently ignore invalid flags define the flags with :throw_on_missing set to false:
+
+```ruby
+class Game < ActiveRecord::Base
+ include SimpleFlaggableColumn
+
+ flag_column :platforms, {
+ win: 0b001,
+ mac: 0b010,
+ linux: 0b100
+ }, throw_on_missing: false
+end
+```
+
+Now invalid flags will be ignored
+
+```ruby
+game = Game.new
+game.platforms = [:win, :potato]
+# => [:win]
+```
+
## Contributing
1. Fork it ( https://github.com/Zequez/simple_flaggable_column/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)