Defect #11545 ยป kernel_open_method_fix.diff
app/models/issue.rb (working copy) | ||
---|---|---|
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 |
|
68 | 67 |
scope :open, lambda {|*args| |
69 | 68 |
is_closed = args.size > 0 ? !args.first : false |
70 | 69 |
{:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status} |
app/models/version.rb (working copy) | ||
---|---|---|
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 |
|
39 | 38 |
scope :open, :conditions => {:status => 'open'} |
40 | 39 |
scope :visible, lambda {|*args| { :include => :project, |
41 | 40 |
:conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } } |
config/initializers/10-patches.rb (working copy) | ||
---|---|---|
10 | 10 |
l("field_#{name.underscore.gsub('/', '_')}_#{attr}", :default => ["field_#{attr}".to_sym, attr]) |
11 | 11 |
end |
12 | 12 |
end |
13 | ||
14 |
# Undefines private Kernel#open method to allow using `open` scopes in models. |
|
15 |
# See Defect #11545 (http://www.redmine.org/issues/11545) for details. |
|
16 |
class Base ; undef open ; end |
|
17 |
class Relation ; undef open ; end |
|
13 | 18 |
end |
14 | 19 | |
15 | 20 |
module ActionView |