How to Tweet from multiple acounts with twitter Gem in Rails?
- by Jmlevick
I have an application wich has Oauth access using Twitter as provider. I also have the ability to ask the logged user permisson to Read and Write in his/her account and once a user authorized the app, I can send tweets as the user with something like:
u = User.find(id)
u.twitter.update("Some-Status-Here")
in the rails console... What I want to do is to Tweet as all the users in one command, but if I try something like:
u = User.all
u.twitter.update("Some-Status-Here")
I get this error:
undefined method `twitter' for #<Array:0x00000002e2f188>
How can I tweet as all the users in one command? What am I doing wrong? I feel it is a very basic thing I'm missing... Can someone help me?
Thank You.