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

The Archive Base Latest Questions

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

I am coming up with a very weird problem with my app running on

  • 0

I am coming up with a very weird problem with my app running on production.

I have the following table called Qrtable and it contains 144 records, each one with code field and time field incrementing by 10minutes.

I then have this scope

    scope :current, where("time > ? and time <= ?", Time.now-14.minutes, Time.now+5.minutes)

What this scope does is to collect the records within the time range and it returns the first and last record. It either returns 1 or 2 records. Every 5 or so minutes the records it has changes.

On my view i am just printing what the first and last records are as so.

    ="#{Qrtable.current.last.code} for time #{Qrtable.current.first.code}"

So now this is what happens. I have this running as development environment on my laptop. Every 5 or so minutes i refresh the page the codes change. But my production is running on a hosted server and when i refresh the page, the codes dont change.

I also noticed that when i do a cap deploy this restarts the server and the codes update for the first time but then after that my scope doesn’t change as i refresh the page. Just wondering if anyone has any idea or has come across this before.

I have tried refreshing Apache multiple times.

  • 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-22T22:03:04+00:00Added an answer on May 22, 2026 at 10:03 pm

    It won’t. It’s evaluated when the class is evaluated. Use:

    scope :current, lambda {where("time > ? and time <= ?", Time.now-14.minutes, Time.now+5.minutes)}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Coming from a Relational world things are obviously very different with the Azure Table
I have a very strange date format coming to me via JSON. e.g. -
I have my undergraduate final year project coming up and am very interested in
I have a very large column-delimited file coming out of a database report in
I'm very new to Windows Form programming, and I'm coming across a problem. I
Im an Android noob, coming from objC, I have a very stupid question (project
I remember coming across a very minimalistic PHP CMS that targets mainly artists as
I'm very new to Python (I'm coming from a JAVA background) and I'm wondering
I'm a Java rookie and I was wondering, if I have the following typical
Yes, this is another question about my game engine, which is coming along very

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.