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 6210299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:08:08+00:00 2026-05-24T06:08:08+00:00

What I need to do is something like a bonus system. Let’s say I

  • 0

What I need to do is something like a bonus system. Let’s say I have a user and number of posts. When user reaches some count on posts (i.e. 100, 300, 550 etc) I want to give him new rank and “money” bonus. But if I’ll check it on new post save, how do I not five this bonus twice or more times (i.e. if posts > n { give bonus; }). How do I make this happen only once?
I thought about having a separate column in DB like bonus_given but how do I use it for different ranks? I don’t know why but I guess the solution of this problem.

PS. I use ruby as my language.

  • 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-05-24T06:08:09+00:00Added an answer on May 24, 2026 at 6:08 am

    I think you gave the answer yourself. You give the user a new rank. You could check if the user needs to be promoted to a higher rank, and if that’s the case, promote him and give the bonus.

    So for example:
    Rank1 is < 100
    Rank2 is >= 100 && < 300
    Rank3 is >= 300 && < 550
    Rank4 is >= 500

    If a user saves his 100th post, and is Rank1, he should be promoted to Rank2 and be given “money” bonus.

    This way you’ll be more flexible if you later on decide to add more Ranks/Different ranges.

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

Sidebar

Related Questions

I want to notify an user using Chrome browser. I need something powerful like
I need something like a bounded queue where I can only insert say 10
I need something like make i.e. dependencies + executing shell commands where failing command
I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible?
Ok, I need something like this: datediff(second, date_one, date_two) < 1 dates are stored
I need to add full web search to my site. I need something like
Normally, we get first value that way: $(#color option:first).val() But I need something like
I need something simple like date , but in seconds since 1970 instead of
What I need is something like this: /<[\w\d]+ ([\w\d]+\=[w\d])+\/>/ Something that would match several
Basically, what I need is something like Dependecy Walker , but it should work

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.