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?