Browse Source

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
tags/4.1.0
Go MAEDA 4 years ago
parent
commit
024f2aef6c
2 changed files with 2 additions and 9 deletions
  1. 0
    1
      .rubocop_todo.yml
  2. 2
    8
      app/models/project.rb

+ 0
- 1
.rubocop_todo.yml View File

@@ -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'


+ 2
- 8
app/models/project.rb View File

@@ -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…
Cancel
Save