Rails sort by facebook likes
===

I need to sort data returned by facebook likes. I assume this means that I will need to add a likes field to my model and then populate this with the number of likes that objects related page has had. 

Just wondering if there is a better way to do this and how I would go about populating the likes column in the db with the number of likes. Just looking for the best method to do this really.

My current idea is to create the likes field and try and populate it from json object returned from facebookgraph so I can use the activerecord order method to sort. Just not sure if this is the best way and the best way to get the data into the db.

Any help would be much appreciated. 