The scope does not refresh production. Using passenger and apache2

I come up with a very strange problem with my production application.

I have the following table called Qrtable and it contains 144 entries, each of which has a code field and a temporary field that increases by 10 minutes.

Then i use this area

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

What is scope is the collection of records within the time range and the return of the first and last record. It returns 1 or 2 records. Every 5 or so minutes the recordings have a change.

In my opinion, I just print what the first and last records are.

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

So here is what happens. It works for me as a development environment on my laptop. Every 5 or so minutes I refresh the page from which the codes change. But my work is done on a hosted server, and when I refresh the page, the codes do not change.

I also noticed that when I do the shutdown, it restarts the server and updates the code for the first time, but after that my area does not change when the page is refreshed. Just wondering if anyone has any ideas or if something happened before.

I tried updating Apache several times.

+3
source share
1 answer

This is not true. It was evaluated in class evaluation. Using:

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

All Articles