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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:03:26+00:00 2026-05-14T07:03:26+00:00

My app is sending messages to client groups. I send message to each client

  • 0

My app is sending messages to client groups. I send message to each client in a loop.

I’m using 3 ActiveRecord models:

class Message < AbstractBase
  has_and_belongs_to_many :groups
end
class Client < ActiveRecord::Base
  has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
  has_and_belongs_to_many :messages
  has_and_belongs_to_many :clients
end

I have to store success info for each client in the loop so in case of error I know where to continue. The idea is to save client’s ID in a table X when a message is successfully sent. If I did it with PHP i would control that manually (new db table for storing clients’ ids).
How would you do that in Ruby on Rails? Do I really need a model for that?

  • 1 1 Answer
  • 1 View
  • 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-05-14T07:03:27+00:00Added an answer on May 14, 2026 at 7:03 am

    You can still access the database directly in rails. Go ahead and make a migration and create your new table. There are many ways to run queries directly in rails. You can run them like this:

    ActiveRecord::Base.connection.select_one(‘SELECT COUNT(*) FROM mytable’)
    or
    ActiveRecord::Base.connection.execute(‘SELECT * FROM mytable’)

    Take a look at connection on ActiveRecord::Base for different ways to do it.

    If you wanted something else, you could take a look at the Sequel gem.

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

Sidebar

Related Questions

In my Android App I send email messages with images attached. Using the Intent
I'm working on a little hack sending MIDI messages from an app using RtMidi
My web app needs to be able to send XMPP messages (Facebook Chat), and
I'm currently creating both the client and server app using ActiveResource for web servicing.
Here is my requirement. I have a client that was sending a specific message
I am sending email using the following utility class, if receiver foo@foo.com is not
My app is sending users email with the following: https://blah.chacha.com/feedback/##comment-reply-169 But for some reason,
I am developing an app for sending some feedback. Basically I'm trying to make
I have a C# app that is sending soap requests over an https channel.
I'd like add to my app function allowing sending email via Outlook same as

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.