mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
use "do end" instead of {} at ActiveRecord scope lambda of app/models/custom_field.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20331 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -50,7 +50,7 @@ class CustomField < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
scope :sorted, lambda {order(:position)}
|
scope :sorted, lambda {order(:position)}
|
||||||
scope :visible, lambda {|*args|
|
scope :visible, (lambda do |*args|
|
||||||
user = args.shift || User.current
|
user = args.shift || User.current
|
||||||
if user.admin?
|
if user.admin?
|
||||||
# nop
|
# nop
|
||||||
@@ -64,7 +64,7 @@ class CustomField < ActiveRecord::Base
|
|||||||
else
|
else
|
||||||
where(:visible => true)
|
where(:visible => true)
|
||||||
end
|
end
|
||||||
}
|
end)
|
||||||
def visible_by?(project, user=User.current)
|
def visible_by?(project, user=User.current)
|
||||||
visible? || user.admin?
|
visible? || user.admin?
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user