fixes for rm2.x
This commit is contained in:
@@ -18,11 +18,11 @@ module RateTimeEntryPatch
|
||||
module ClassMethods
|
||||
# Updated the cached cost of all TimeEntries for user and project
|
||||
def update_cost_cache(user, project=nil)
|
||||
c = ARCondition.new
|
||||
c << ["#{TimeEntry.table_name}.user_id = ?", user]
|
||||
c << ["#{TimeEntry.table_name}.project_id = ?", project] if project
|
||||
#c = ARCondition.new
|
||||
c = "#{TimeEntry.table_name}.user_id = %d" % [user.id]
|
||||
c << " AND #{TimeEntry.table_name}.project_id = %d" % [project.id] if project
|
||||
|
||||
TimeEntry.all(:conditions => c.conditions).each do |time_entry|
|
||||
TimeEntry.all(:conditions => c ).each do |time_entry|
|
||||
time_entry.save_cached_cost
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user