Skip to content

Commit

Permalink
Rubocop: Whitespace, zero length predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Jan 10, 2017
1 parent 5313869 commit 6d141dd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
20 changes: 0 additions & 20 deletions .rubocop_todo.yml
Expand Up @@ -746,20 +746,6 @@ Style/TernaryParentheses:
- 'app/helpers/application_helper.rb'
- 'app/helpers/tasks_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: final_newline, final_blank_line
Style/TrailingBlankLines:
Exclude:
- 'config/initializers/paper_trail.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/TrailingWhitespace:
Exclude:
- 'app/models/users/user.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
Expand Down Expand Up @@ -806,9 +792,3 @@ Style/WordArray:
EnforcedStyle: percent
MinSize: 5

# Offense count: 2
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
Exclude:
- 'app/models/polymorphic/version.rb'
- 'lib/gravatar_image_tag.rb'
2 changes: 1 addition & 1 deletion app/models/polymorphic/version.rb
Expand Up @@ -32,7 +32,7 @@ def recent_for_user(user, limit = 10)
.offset(offset)
.default_order

break if query.size == 0
break if query.empty?
versions += query.select { |v| v.item.present? }
versions.uniq! { |v| [v.item_id, v.item_type] }
offset += limit * 2
Expand Down
2 changes: 1 addition & 1 deletion app/models/users/user.rb
Expand Up @@ -161,7 +161,7 @@ def check_if_current_user
def has_related_assets?
sum = %w(Account Campaign Lead Contact Opportunity Comment Task).detect do |asset|
klass = asset.constantize

asset != "Comment" && klass.assigned_to(self).exists? || klass.created_by(self).exists?
end
!sum.nil?
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/paper_trail.rb
@@ -1 +1 @@
PaperTrail.config.track_associations = false
PaperTrail.config.track_associations = false
2 changes: 1 addition & 1 deletion lib/gravatar_image_tag.rb
Expand Up @@ -50,7 +50,7 @@ def self.gravatar_id(email, filetype = nil)
end

def self.url_params(gravatar_params)
return nil if gravatar_params.keys.size == 0
return nil if gravatar_params.keys.empty?
"?#{gravatar_params.map { |key, value| "#{key}=#{URI.escape(value.is_a?(String) ? value : value.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}" }.join('&')}"
end
end
Expand Down

0 comments on commit 6d141dd

Please sign in to comment.