Corrected with rubocop cop 'Style/SymbolProc'.

This commit is contained in:
Thorsten Eckel 2015-05-07 12:25:16 +02:00
parent a87482c8dd
commit fc5e3696a2
9 changed files with 9 additions and 29 deletions

View file

@ -182,10 +182,6 @@ Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.'
Enabled: false
Style/SymbolProc:
Description: 'Use symbols as procs instead of blocks when possible.'
Enabled: false
Style/SignalException:
Description: 'Checks for proper usage of fail and raise.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'

View file

@ -130,9 +130,7 @@ class Link < ApplicationModel
link_object_target_id: data[:link_object_target_id],
link_object_target_value: data[:link_object_target_value]
)
links.each { |link|
link.destroy
}
links.each(&:destroy)
# from the other site
if data.key?(:link_type)
@ -146,9 +144,7 @@ class Link < ApplicationModel
link_object_source_id: data[:link_object_target_id],
link_object_source_value: data[:link_object_target_value]
)
links.each { |link|
link.destroy
}
links.each(&:destroy)
end
def self.link_type_get(data)

View file

@ -19,9 +19,7 @@ class Observer::Organization::RefObjectTouch < ActiveRecord::Observer
return if Setting.get('import_mode')
# touch organizations tickets
Ticket.select('id').where( organization_id: record.id ).each {|ticket|
ticket.touch
}
Ticket.select('id').where( organization_id: record.id ).each(&:touch)
# touch current members
record.member_ids.uniq.each {|user_id|

View file

@ -43,9 +43,7 @@ class Tag < ApplicationModel
tag_item_id: tag_item_id,
o_id: data[:o_id],
)
result.each { |item|
item.destroy
}
result.each(&:destroy)
true
end

View file

@ -128,9 +128,7 @@ returns
def merge_to(data)
# update articles
Ticket::Article.where( ticket_id: self.id ).each {|article|
article.touch
}
Ticket::Article.where( ticket_id: self.id ).each(&:touch)
# quiet update of reassign of articles
Ticket::Article.where( ticket_id: self.id ).update_all( ['ticket_id = ?', data[:ticket_id] ] )

View file

@ -18,9 +18,7 @@ returns
state_list_open = Ticket::State.by_category( 'open' )
tickets = Ticket.where( state_id: state_list_open )
tickets.each {|ticket|
ticket.escalation_calculation
}
tickets.each(&:escalation_calculation)
end
=begin

View file

@ -66,7 +66,7 @@ class String
# see also test/fixtures/mail21.box
# note: string.encode!('UTF-8', 'UTF-8', :invalid => :replace, :replace => '?') was not detecting invalid chars
if !string.valid_encoding?
string = string.chars.select { |c| c.valid_encoding? }.join
string = string.chars.select(&:valid_encoding?).join
end
# find <a href=....> and replace it with [x]

View file

@ -52,9 +52,7 @@ class Sessions::Client
self.log "---client - looking for data of user #{user.id}"
# push messages from backends
backend_pool.each {|pool|
pool.push
}
backend_pool.each(&:push)
self.log '---/client-'

View file

@ -30,9 +30,7 @@ class TwitterTest < ActiveSupport::TestCase
# add channel
current = Channel.where( adapter: 'Twitter2' )
current.each {|r|
r.destroy
}
current.each(&:destroy)
Channel.create(
adapter: 'Twitter2',
area: 'Twitter::Inbound',