Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8243355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:29:26+00:00 2026-06-07T21:29:26+00:00

I need to sort activerecord data by facebook likes. I assume this means that

  • 0

I need to sort activerecord data 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:29:28+00:00Added an answer on June 7, 2026 at 9:29 pm

    There doesn’t seem to be anything wrong with what you are suggesting, but you should bear in mind that storing the number of likes in a model is going to require you to update that frequently with the number of likes from the Facebook Graph API (which is what I assume that you are using).

    It might be better to not store the number of likes directly in your application, but simply pull them when your app needs them – this way you will know they are up-to-date, and a post hasn’t been liked/unliked since you last polled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to sort an array that can look like this: $array[4][0] = array('id'
Sorry for my English. I need sort nodes of this XML data <root> <section
I need to sort a field name of that contains some name, NULL and
I need to sort my view by a specific field that is actually a
I have a rails model that looks something like this: class Recipe < ActiveRecord::Base
I have a model that looks something like this: class Comment < ActiveRecord::Base ...
I need to sort on a date-field type, which name is mod_date. It works
I need to sort then print the result increasing and decreasing. I have some
I need to sort many files and then dump into many files in order
I need some sort of an algorithm, that would try to find free space

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.