New answers tagged ruby-on-rails
You can get the analogy from global variables or variables passed by reference, and think of partials as functions. So using instance variable is pretty much like variable passed to function as reference with all it's pro's and con's: # controller def index @var = 1 end #view index.html.erb <%= @var %><br/> <%= render 'foo' ...
It really depends on how you plan to use this later. You are anyway one migration (and some code changes ofc) from changing this solution from one to the other. So I would choose whatever, and later benchmark it in a way your users really use the system. Even better - profile the app and look for bottlenecks first, instead of optimizing it prematurely. ...
There's actually no other way to get this info than fetching the data. You would have to dive into each API to look for ways to minimize your work. Some could accept ETag, or "Last-Modified" so your request ends quickly if nothing is there ;) Facebook for example allows you to ask for few resources at once ...
I would suggest creating web service to store such users. It's easier to maintain and test with such soulution. You don't want to coordinate development of every tool each time you need to update DB schema, do you?
Top 50 recent answers are included