mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
Code cleanup: RuboCop: Fix Style/IdenticalConditionalBranches in app/models/project.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18380 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3495cba92b
commit
024f2aef6c
@ -1390,7 +1390,6 @@ Style/HashSyntax:
|
||||
|
||||
Style/IdenticalConditionalBranches:
|
||||
Exclude:
|
||||
- 'app/models/project.rb'
|
||||
- 'config/initializers/10-patches.rb'
|
||||
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
|
||||
|
||||
|
||||
@ -93,14 +93,8 @@ class Project < ActiveRecord::Base
|
||||
scope :all_public, lambda { where(:is_public => true) }
|
||||
scope :visible, lambda {|*args| where(Project.visible_condition(args.shift || User.current, *args)) }
|
||||
scope :allowed_to, lambda {|*args|
|
||||
user = User.current
|
||||
permission = nil
|
||||
if args.first.is_a?(Symbol)
|
||||
permission = args.shift
|
||||
else
|
||||
user = args.shift
|
||||
permission = args.shift
|
||||
end
|
||||
user = args.first.is_a?(Symbol) ? User.current : args.shift
|
||||
permission = args.shift
|
||||
where(Project.allowed_to_condition(user, permission, *args))
|
||||
}
|
||||
scope :like, lambda {|arg|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user