I am working on a Rails 3.2 application. We are running on Ruby 1.9.3 and Postgres 9.1.3. Most of the content on the site is organized by a published_at datetime stamp. The public facing queries ask for content in relation to the Time.zone.now:
Post.where(["published_at <= ?", Time.zone.now]).order("published_at DESC")When I go into the console and run this query, I get exactly the posts that I expect. However, the application controller in production seems to be caching and is not bringing in new content that may be relevant based on it's published_at timestamp.
I realize I can disable caching using 'config.action_controller.perform_caching' in the production environment config file, but this seems like very bad form as I will be caching view content in the future.
Is there something I am missing to make the Controller actually make legitimate database calls regularly? Is this a Rails issue or a Postgres configuration issue?
Thanks!
--
You received this message because you are subscribed to the Google Groups "Asheville Ruby Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asheville-rb...@googlegroups.com.
To post to this group, send email to ashevi...@googlegroups.com.
Visit this group at http://groups.google.com/group/asheville-rb?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Post.uncached{ Post.where(["published_at <= ?", Time.zone.now]).order("published_at DESC") }
"There are only two hard problems in Computer Science:
cache invalidation and naming things."
-- Phil Karltonconfig.time_zone = 'Eastern Time (US & Canada)') as well as your server to use EST? This probably would not be the issue if you were testing the console on the actual production server.