mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +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:
|
Style/IdenticalConditionalBranches:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/project.rb'
|
|
||||||
- 'config/initializers/10-patches.rb'
|
- 'config/initializers/10-patches.rb'
|
||||||
- 'lib/redmine/wiki_formatting/textile/redcloth3.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 :all_public, lambda { where(:is_public => true) }
|
||||||
scope :visible, lambda {|*args| where(Project.visible_condition(args.shift || User.current, *args)) }
|
scope :visible, lambda {|*args| where(Project.visible_condition(args.shift || User.current, *args)) }
|
||||||
scope :allowed_to, lambda {|*args|
|
scope :allowed_to, lambda {|*args|
|
||||||
user = User.current
|
user = args.first.is_a?(Symbol) ? User.current : args.shift
|
||||||
permission = nil
|
permission = args.shift
|
||||||
if args.first.is_a?(Symbol)
|
|
||||||
permission = args.shift
|
|
||||||
else
|
|
||||||
user = args.shift
|
|
||||||
permission = args.shift
|
|
||||||
end
|
|
||||||
where(Project.allowed_to_condition(user, permission, *args))
|
where(Project.allowed_to_condition(user, permission, *args))
|
||||||
}
|
}
|
||||||
scope :like, lambda {|arg|
|
scope :like, lambda {|arg|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user