I have a e-mail system and I want that an user can decide with checkboxes what message want receive when happen determinate events, e.g.
field :when_receive_order, :type => Boolean, :default => "true"
field :when_accept_order, :type => Boolean, :default => "true"
field :when_cancel_order, :type => Boolean, :default => "true"
field :when_reject_order, :type => Boolean, :default => "true"
.
.
.
more...
I want to know if is good use Boolean values or use state_machine gem in these case.
In this link http://railstips.org/blog/archives/2012/10/10/booleans-are-baaaaaaaaaad/ is argued that Boolean values are bad. So I make this question.
Note: My database is mongodb and my odm es mongoid
If there is only one of those boolean values to be true at all times, you can use state_machine. Otherwise, you cannot.
In your case, I think it is possible that more than one values could be true. What if a user want to receive mails both when an order is accepted and when an order is canceled? So you cannot use state_machine.