diff --git a/app/models/rate.rb b/app/models/rate.rb index 16fa7a3..a6d4303 100644 --- a/app/models/rate.rb +++ b/app/models/rate.rb @@ -145,7 +145,7 @@ class Rate < ActiveRecord::Base options = {:retries => 0, :suspend => 1} options[:max_age] = 1 if force - Lockfile(CACHING_LOCK_FILE_NAME, options) do + Lockfile(lock_file, options) do block.call end end @@ -154,4 +154,8 @@ class Rate < ActiveRecord::Base public generator_for :date_in_effect => Date.today end + + def self.lock_file + Rails.root + 'tmp' + Rate::CACHING_LOCK_FILE_NAME + end end