From b9b39014aeacf75ab6150934fb9c616c224b52e8 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 3 Jul 2015 17:35:28 +0200 Subject: [PATCH] Applied rubocop cop 'Style/WordArray'. --- lib/models.rb | 2 +- test/unit/model_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models.rb b/lib/models.rb index a676f901f..d2f9d2761 100644 --- a/lib/models.rb +++ b/lib/models.rb @@ -81,7 +81,7 @@ returns list.each {|model_class, model_attributes| references[:model][model_class.to_s] = 0 next if !model_attributes[:attributes] - ['created_by_id', 'updated_by_id'].each {|item| + %w(created_by_id updated_by_id).each {|item| if model_attributes[:attributes].include?(item) count = model_class.where("#{item} = ?", object_id).count next if count == 0 diff --git a/test/unit/model_test.rb b/test/unit/model_test.rb index 6af3d2517..8ec188acf 100644 --- a/test/unit/model_test.rb +++ b/test/unit/model_test.rb @@ -6,7 +6,7 @@ class ModelTest < ActiveSupport::TestCase # create base groups = Group.where( name: 'Users' ) - roles = Role.where( name: ['Agent', 'Admin'] ) + roles = Role.where( name: %w(Agent Admin) ) agent1 = User.create_or_update( login: 'model-agent1@example.com', firstname: 'Model',