Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:15:32+00:00 2026-06-13T03:15:32+00:00

I have a e-mail system and I want that an user can decide with

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:15:34+00:00Added an answer on June 13, 2026 at 3:15 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small email application that lets a user build a message from
I have built a php mail system. now I want to also send attachments
I am trying to design an mail system. I have stuttered on the problem
I have code for sending email to clients. System.Net.Mail.SmtpClient Client = new System.Net.Mail.SmtpClient(); MailMessage
I have mail server configuration data (server - user name - password - port)
I have a mail webform where I have to show the user only (-1)
I have implemented mail composer. But it opens mail composer whenever user had implemented
I have created one application which is reading outlook mail, but when user install
EDIT ive got it almost, having and error message now that it can't find
I'm building a system that will send verses of scripture to subscribers over e-mail.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.