Project

General

Profile

Defect #11545 ยป kernel_open_method_fix.diff

Alexander Markelov, 2012-08-12 18:56

View differences:

app/models/issue.rb (working copy)
lambda {|*args| { :include => :project,
:conditions => Issue.visible_condition(args.shift || User.current, *args) } }
class << self; undef :open; end
scope :open, lambda {|*args|
is_closed = args.size > 0 ? !args.first : false
{:conditions => ["#{IssueStatus.table_name}.is_closed = ?", is_closed], :include => :status}
app/models/version.rb (working copy)
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}}
class << self; undef :open; end
scope :open, :conditions => {:status => 'open'}
scope :visible, lambda {|*args| { :include => :project,
:conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } }
config/initializers/10-patches.rb (working copy)
l("field_#{name.underscore.gsub('/', '_')}_#{attr}", :default => ["field_#{attr}".to_sym, attr])
end
end
# Undefines private Kernel#open method to allow using `open` scopes in models.
# See Defect #11545 (http://www.redmine.org/issues/11545) for details.
class Base ; undef open ; end
class Relation ; undef open ; end
end
module ActionView
    (1-1/1)