diff options
author | Johan Sørensen <johan@johansorensen.com> | 2009-07-22 21:00:09 +0200 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2009-07-22 21:00:09 +0200 |
commit | 4581182b740a1c87708546de32bccf02d08486c5 (patch) | |
tree | 8ddfebd65d8743da3e052f39986cb5318e7a3ada /app/models/merge_request.rb | |
parent | 6483d9fd83bedd7f91b454b7a46d12c051bede5e (diff) | |
download | gitorious-mainline-outdated-4581182b740a1c87708546de32bccf02d08486c5.zip gitorious-mainline-outdated-4581182b740a1c87708546de32bccf02d08486c5.tar.gz gitorious-mainline-outdated-4581182b740a1c87708546de32bccf02d08486c5.tar.bz2 |
Make sure pending merge requests are never included in the scopes or #from_filter
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 42d4acf..dafffe8 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -80,12 +80,12 @@ class MergeRequest < ActiveRecord::Base end end - named_scope :open, :conditions => ['LCASE(status_tag) in (?) OR status_tag IS NULL', ['open','verifying']] - named_scope :closed, :conditions => ["LCASE(status_tag) in (?)", ['merged','rejected']] - named_scope :merged, :conditions => ["LCASE(status_tag) = ?", 'merged'] - named_scope :rejected, :conditions => ["LCASE(status_tag) = ?", 'rejected'] + named_scope :open, :conditions => ['(LCASE(status_tag) in (?) OR status_tag IS NULL) AND status != ?', ['open','verifying'], STATUS_PENDING_ACCEPTANCE_OF_TERMS] + named_scope :closed, :conditions => ["LCASE(status_tag) in (?) AND status != ?", ['merged','rejected'], STATUS_PENDING_ACCEPTANCE_OF_TERMS] + named_scope :merged, :conditions => ["LCASE(status_tag) = ? AND status != ?", 'merged', STATUS_PENDING_ACCEPTANCE_OF_TERMS] + named_scope :rejected, :conditions => ["LCASE(status_tag) = ? AND status != ?", 'rejected', STATUS_PENDING_ACCEPTANCE_OF_TERMS] named_scope :by_status, lambda {|state| - {:conditions => ["LCASE(status_tag) = ?", state ] } + {:conditions => ["LCASE(status_tag) = ? AND status != ?", state, STATUS_PENDING_ACCEPTANCE_OF_TERMS ] } } |