activerecord organization caching date value conditions clause
my account denote following twin associations:
has_many :expenses,
:order => 'expenses.dated_on desc',
:dependent => :destroy
has_many :recent_expenses,
:class_name => 'expense',
:conditions => "expenses.dated_on <= '#{date.today}'",
:order => 'dated_on desc',
:limit => 5
in views i'm digest new rubbish so:
<% @account.recent_expenses.each |expense| %>
...
<% finish %>
on growth machine, party server (which runs prolongation mode) also prolongation console, @account.recent_expenses advantage repremand list. however, the live prolongation server, many new rubbish returned.
if i reinstate @account.recent_expenses @account.expenses view, many new rubbish are displayed, speculation #{date.today} biased conditions apportionment somehow being cached initial executed. i restart prolongation dog cluster, latest rubbish returned correctly.
can anyone cruise since start competence i change :recent_expenses query hinder happening?
i'm controlling rails 2.1.0.
Comments
Post a Comment