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 8255707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:37:05+00:00 2026-06-08T01:37:05+00:00

I have a questions regarding implementation of a system that will send messages to

  • 0

I have a questions regarding implementation of a system that will send messages to subgroups of people held in a database.

The [potential] message Recipients are held in a table. Each Recipient record has a set of column booleans indicating whether they are a member of a particular group or not: msg_group_1:boolean, msg_group_2:boolean, etc. Recipients may belong to more than one group.

There is also a Message table, where each message record has a corresponding set of booleans for indicating which groups the message is intended for.

Then, when a new message is composed, the form includes a checkbox to indicate which groups the message is intended for.

To implement the Send, I then need to find all members of the Recipients table that belong to any of the groups that the new Message is intended for.

I can’t use,

Recipients.find(:all, :conditions => ['msg_group_1 = ? OR msg_group_2 = ?', @message.msg_group_1, @message.msg_group_2])

…as this will match records where the booleans are equal, even if the pair are booleans are both false (obviously I only want cases where both flags are true).

Is there an efficient way to ‘find’ these using a SQL search, or some other Ruby on Rails trick that will obtain the matching records where both flags are true?

Thanks.

  • 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-08T01:37:08+00:00Added an answer on June 8, 2026 at 1:37 am

    OK, This question has been open for 5 months at time of writing, and no-one has offered a solution so the ‘answer’ seems to be that this is not possible.

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

Sidebar

Related Questions

I have a question regarding my database design and its implementation that i am
I have some questions regarding the following css that I found: html, body {
I actually have two questions regarding exception/error handling in the iPhone app that I
I see that there have been similar questions asked here regarding wrapping unmanaged C++
I have a few questions regarding the WakefulIntentService implementation by CWAC: 1) Is it
I have a questions regarding synchronization of HashMap. The background is that I am
I have some questions regarding read-write locks in POSIX Pthreads on a *nix system,
I have couple questions regarding some C++ rules. Why am I able to call
I have several questions regarding filenames and the iPod Library. I understand I can
I have a questions regarding databases for ASP.Net 4.0 MVC3 (or 4 Beta). I'm

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.