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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:52:22+00:00 2026-05-19T17:52:22+00:00

The situation: The magazine accepts submissions. Once you submit, an editor will schedule your

  • 0

The situation:

The magazine accepts submissions. Once you submit, an editor will schedule your submission for review. Once it has been reviewed, you are no longer allowed to edit it.

So, I have submission in various states. “Draft”, “queued”, “reviewed”, etc. Most of the switches into these various states are triggered by some action, e.g., a submission becomes queued when an editor schedules it. Easy peasey. However, the switch into the “reviewed” state is not triggered by any action, it just happens after a certain datetime has passed.

I have two thoughts on how to accomplish this:

  1. Run a daily/hourly cron job to check up on all the queued submissions and switch them to reviewed if necessary. I dislike this because
    1. I would prefer it to be hourly, so that I can edit my submission up to three hours before a meeting starts
    2. Hourly cron jobs cost money on Heroku, and this application will either never make money or won’t make money for months and months to come
  2. Somehow construct a before_load ActiveRecord callback, that will perform some logic on submissions each time they are loaded. “Queued? No? Nevermind. Otherwise, switch it to ‘Reviewed’ if its meeting is less than three hours away.”

I wanted to get people’s input on the second idea.

  1. Is that an atrociously smelly way to accomplish this?
  2. If so, can you suggest an awesomer third way?
  3. If ‘no’ to both of the above, can you give tips on how to perform such logic each time a record is loaded from the database? I would need to always perform some logic before doing a select from the submissions table (which is gearing up to be the most-queried table in the app…)

If there’s no good way to accomplish Option Two (or, I hope!, Option Three), I will resort to Option One with a daily cron job. Being able to edit up to a day before a meeting will just have to suffice.

  • 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-19T17:52:23+00:00Added an answer on May 19, 2026 at 5:52 pm

    Maybe using after_find, although your performance will sort of suck, same goes if you do something as crazy as before_load, performance would suck, that said money might be more important than performance, if that is so, I would go with the after_find.

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

Sidebar

Related Questions

Situation I have been working on a project lately where the UI development seems
OK, this is impossible, but I will try to explain the situation here. Let's
Situation I'm implementing a Listener for PHPUnit that will record test results to a
I was reading the following article: http://msdn.microsoft.com/en-us/magazine/cc817398.aspx Solving 11 Likely Problems In Your Multithreaded
Situation: Google has indexed a page in a forum. The thread is now deleted.
Situation There is a high chance that users will not interact directly with the
Situation: Table TBL has ~10k entries for deletion, Table TBL has 14 child tables
Situation: need to find which layer the user has touched. Problem: Apple says we
Situation: Our client (owner of domain.com) has set the A record for www.domain.com to
Situation: I have several Gridviews on one page, and each Gridview has a dynamically

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.