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

  • SEARCH
  • Home
  • 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 4623888
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:03:08+00:00 2026-05-22T03:03:08+00:00

I have a site that has user submissions that users can vote on. I

  • 0

I have a site that has user submissions that users can vote on. I want to be able to organize these submissions on my homepage in a variety of fashions, but the most complex one is the “Currently Popular”. I assume the best way to go about this is named scopes, but I’m not exactly sure how to do it.

Each submission has the attributes: votes_up:integer, and votes_down:integer

I think the best way to do this will be to find the ratio of votes_up / (votes_up + votes_down), all within the last day. I additionally have a Votes model that has: submission_id, vote_type ("up" or "down"), and user_id. Obviously both submissions and votes have created_at:datetimes I think it would be better if it returned results that had a large quantity of votes in the last 1 day, rather than submissions that are from the last 1 day (that way submissions that take time to gather steam can still qualify)

How would I structure a query that will return submissions in this order with the date limitations?

Does this make sense?

thanks!

  • 1 1 Answer
  • 1 View
  • 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-05-22T03:03:09+00:00Added an answer on May 22, 2026 at 3:03 am

    Popular with whom? With a / a + b you’ll get a lot of noise when you have just a handful of votes, and when you have a controversial subject the votes won’t at all reflect the quality of the material. People take sides and engage in politics, and people with bad opinions will tend to vote way too much.

    The theoretically ideal way to deal with this is to highlight content that someone the user usually agrees with endorses and hide the stuff from people who they disagree with. A special list can have the most controversial subjects. This approach can be resource intensive, and I don’t know how well Ruby on Rails does database optimization.

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

Sidebar

Related Questions

I am working on a site that has tests users can take. I have
I have a site that allows users to vote on images. Each image has
I have a page in my site that has allows users to search for
I have a site that gets a user to approve another users access to
I have a site that has subdomains for each user and a wildcard SSL
I have a site that has 2 DIV tags, one floats left the other
Information: I have a site that has a design on index.php, and then you
I have a paging control on my site that has it's container element set
I have a Rails 2.1.2 site that only has html templates e.g. jobs.html.erb, so
Currently I have a site where it has a header that looks something like

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.