Use lambda form in model scopes (#12499)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10949 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Baptiste Barth
2012-12-07 10:12:47 +00:00
parent 8201761e77
commit 4896d5c7e8
12 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ class Version < ActiveRecord::Base
validate :validate_version
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
scope :open, where(:status => 'open')
scope :open, lambda { where(:status => 'open') }
scope :visible, lambda {|*args|
includes(:project).where(Project.allowed_to_condition(args.first || User.current, :view_issues))
}