@@ -64,6 +64,7 class Issue < ActiveRecord::Base | |||
|
64 | 64 | lambda {|*args| { :include => :project, |
|
65 | 65 | :conditions => Issue.visible_condition(args.shift || User.current, *args) } } |
|
66 | 66 | |
|
67 | class << self; undef :open; end | |
|
67 | 68 | scope :open, lambda {|*args| |
|
68 | 69 | is_closed = args.size > 0 ? !args.first : false |
|
69 | 70 | {:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status} |
@@ -35,6 +35,7 class Version < ActiveRecord::Base | |||
|
35 | 35 | validates_inclusion_of :sharing, :in => VERSION_SHARINGS |
|
36 | 36 | |
|
37 | 37 | scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} |
|
38 | class << self; undef :open; end | |
|
38 | 39 | scope :open, :conditions => {:status => 'open'} |
|
39 | 40 | scope :visible, lambda {|*args| { :include => :project, |
|
40 | 41 | :conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } } |
General Comments 0
You need to be logged in to leave comments.
Login now