Skip to content

Commit fc346d4

Browse files
author
Awesome Code
committed
Auto corrected by following Lint Ruby Style/SymbolArray
1 parent ed40b1d commit fc346d4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/rails/convert_models_2_3_to_3_0.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
Post.where("title = ?", title).destroy_all
9393
EOF
9494

95-
keys = [:conditions, :order, :joins, :select, :from, :having, :group, :include, :limit, :offset, :lock, :readonly]
95+
keys = %i[conditions order joins select from having group include limit offset lock readonly]
9696
keys_converters = {
9797
:conditions => :where,
9898
:include => :includes
@@ -112,7 +112,7 @@
112112
helper_method :generate_batch_options do |hash_node|
113113
options = []
114114
hash_node.children.each do |pair_node|
115-
if [:start, :batch_size].include? pair_node.key.to_value
115+
if %i[start batch_size].include? pair_node.key.to_value
116116
options << pair_node.to_source
117117
end
118118
end
@@ -232,7 +232,7 @@
232232
replace_with add_receiver_if_necessary('all')
233233
end
234234

235-
[:first, :last].each do |message|
235+
%i[first last].each do |message|
236236
# Post.find(:last, :conditions => {:title => "test"})
237237
# =>
238238
# Post.where(:title => "title").last

lib/rails/convert_routes_2_3_to_3_0.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
# => post "/admin_signup", :to => "admin_signup#new", :as => "admin_signup"
293293
within_node type: 'send', receiver: 'map' do
294294
message = node.message
295-
unless [:root, :connect, :resource, :resources].include? message
295+
unless %i[root connect resource resources].include? message
296296
url = node.arguments.first.to_value
297297
hash_node = node.arguments.last
298298
if hash_node.type == :hash

lib/rails/upgrade_3_2_to_4_0.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
other_arguments_str = node.arguments[0...-1].map(&:to_source).join(', ')
280280
confirm = hash.hash_value(:confirm).to_source
281281
other_options = hash.children.map { |pair|
282-
unless [:confirm, :data].include?(pair.key.to_value)
282+
unless %i[confirm data].include?(pair.key.to_value)
283283
if pair.key.type == :sym
284284
"#{pair.key.to_value}: #{pair.value.to_source}"
285285
else

lib/will_paginate/use_new_syntax.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
if_gem 'will_paginate', { gte: '3.0.0' }
1919

20-
ar_keys = [:conditions, :order, :joins, :select, :from, :having, :group, :include, :limit, :offset, :lock, :readonly]
21-
wp_keys = [:page, :per_page]
20+
ar_keys = %i[conditions order joins select from having group include limit offset lock readonly]
21+
wp_keys = %i[page per_page]
2222
ar_keys_converters = {
2323
:conditions => :where,
2424
:include => :includes

0 commit comments

Comments
 (0)