Skip to content

Commit

Permalink
Fix safe performance offences
Browse files Browse the repository at this point in the history
Also ignore Minitest/NonExecutableTestMethod for the moment because of
#927
  • Loading branch information
tagliala committed Dec 24, 2023
1 parent c6ca746 commit d76b59d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Metrics/PerceivedComplexity:
Minitest/MultipleAssertions:
Enabled: false

# FIXME: DavyJonesLocker/client_side_validations#927
Minitest/NonExecutableTestMethod:
Enabled: false

Rails/ApplicationRecord:
Exclude:
- 'test/**/*'
Expand Down
2 changes: 1 addition & 1 deletion lib/client_side_validations/extender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Extender
def extend(klass, validators)
validators.each do |validator|
require "client_side_validations/#{klass.underscore}/#{validator.downcase}"
const_get(klass)::Validations.const_get("#{validator}Validator").send :include, ClientSideValidations.const_get(klass).const_get(validator)
const_get(klass)::Validations.const_get(:"#{validator}Validator").send :include, ClientSideValidations.const_get(klass).const_get(validator)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/action_view/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Category

def initialize(params = {})
params.each do |attr, value|
public_send("#{attr}=", value)
public_send(:"#{attr}=", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/action_view/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Comment

def initialize(params = {})
params.each do |attr, value|
public_send("#{attr}=", value)
public_send(:"#{attr}=", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/action_view/models/format_thing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class FormatThing

def initialize(params = {})
params.each do |attr, value|
public_send("#{attr}=", value)
public_send(:"#{attr}=", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/action_view/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Post

def initialize(params = {})
params.each do |attr, value|
public_send("#{attr}=", value)
public_send(:"#{attr}=", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/action_view/models/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Tag

def initialize(params = {})
params.each do |attr, value|
public_send("#{attr}=", value)
public_send(:"#{attr}=", value)
end
end

Expand Down

0 comments on commit d76b59d

Please sign in to comment.