Skip to content

Commit

Permalink
Rubocop: Performance/CompareWithBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Dec 21, 2017
1 parent 5c347c9 commit e6fa8f8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Expand Up @@ -311,14 +311,6 @@ Naming/VariableNumber:
Exclude:
- 'spec/controllers/home_controller_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
Performance/CompareWithBlock:
Exclude:
- 'app/views/application/index.atom.builder'
- 'app/views/application/show.atom.builder'
- 'app/views/home/index.atom.builder'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/index.atom.builder
Expand Up @@ -10,7 +10,7 @@ end

atom_feed do |feed|
feed.title title || t(items.to_sym)
feed.updated assets.any? ? assets.max { |a, b| a.updated_at <=> b.updated_at }.updated_at : Time.now
feed.updated assets.any? ? assets.max_by(&:updated_at).updated_at : Time.now
feed.generator "Fat Free CRM v#{FatFreeCRM::VERSION::STRING}"
feed.author do |author|
author.name @current_user.full_name
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/show.atom.builder
Expand Up @@ -8,7 +8,7 @@ end

atom_feed do |feed|
feed.title title || t(@items.to_sym)
feed.updated @assets.any? ? @assets.max { |a, b| a.updated_at <=> b.updated_at }.updated_at : Time.now
feed.updated @assets.any? ? @assets.max_by(&:updated_at).updated_at : Time.now
feed.generator "Fat Free CRM v#{FatFreeCRM::VERSION::STRING}"
feed.author do |author|
author.name @current_user.full_name
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.atom.builder
Expand Up @@ -5,7 +5,7 @@ assets = controller.instance_variable_get("@#{items}")

atom_feed do |feed|
feed.title t(:activities)
feed.updated @activities.max { |a, b| a.created_at <=> b.created_at }.try(:created_at)
feed.updated @activities.max_by(&:created_at).try(:created_at)
feed.generator "Fat Free CRM v#{FatFreeCRM::VERSION::STRING}"
feed.author do |author|
author.name @current_user.full_name
Expand Down
1 change: 1 addition & 0 deletions fat_free_crm.gemspec
@@ -1,4 +1,5 @@
# -*- encoding: utf-8 -*-

$LOAD_PATH.push File.expand_path('../vendor/gems/globby-0.1.2/lib', __FILE__)
require 'globby'
rules = File.read("#{File.expand_path('..', __FILE__)}/.gitignore").split("\n")
Expand Down

0 comments on commit e6fa8f8

Please sign in to comment.