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