Fixed a bug where Rates on a project were being selected by the default
rate finder. #1921
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ class Rate < ActiveRecord::Base
|
||||
return Rate.find(:first,
|
||||
:order => 'date_in_effect DESC',
|
||||
:conditions => [
|
||||
"user_id IN (?) AND date_in_effect <= ?",
|
||||
"user_id IN (?) AND date_in_effect <= ? AND project_id IS NULL",
|
||||
user.id,
|
||||
date
|
||||
])
|
||||
|
||||
@@ -287,7 +287,7 @@ describe Rate, 'for_user_project_and_date (private)' do
|
||||
|
||||
it 'should search rates without a project when +project+ is nil' do
|
||||
Rate.should_receive(:find).with(:first, {
|
||||
:conditions => ["user_id IN (?) AND date_in_effect <= ?",
|
||||
:conditions => ["user_id IN (?) AND date_in_effect <= ? AND project_id IS NULL",
|
||||
@user.id,
|
||||
@date
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user