n00b question. I'm trying to loop through every User record in my database. The pseudo code might look a little something like this:
def send_notifications
render :nothing => true
# Randomly select Message record from DB
@message = Message.offset(rand(Message.count)).first
random_message = @message.content
@user = User.all.entries.each do
@user = User.find(:id)
number_to_text = ""
@user.number = number_to_text #number is a User's phone number
puts @user.number
end
end
Can someone fill me in on the best approach for doing this? A little help with the syntax would be great too :)