mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Style/SendWithLiteralMethodName
Use method call directly instead of `public_send` with fixed argument. The cop is declared unsafe. I think that is because it can also replace `send` but we replace only `public_send` here.
This commit is contained in:
committed by
zanetagebka
parent
8b4759ee05
commit
5925b023b3
@@ -146,7 +146,7 @@ module Admin
|
||||
return nil if parent_data.blank?
|
||||
|
||||
@parent ||= parent_data[:model_class].
|
||||
public_send("find_by", parent_data[:find_by] => params["#{model_name}_id"])
|
||||
find_by(parent_data[:find_by] => params["#{model_name}_id"])
|
||||
instance_variable_set("@#{model_name}", @parent)
|
||||
end
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ module Reporting
|
||||
end
|
||||
|
||||
def selecting(lambda)
|
||||
fields = instance_exec(&lambda).map{ |key, value| value.public_send(:as, key.to_s) }
|
||||
fields = instance_exec(&lambda).map{ |key, value| value.as(key.to_s) }
|
||||
|
||||
reflect query.project(*fields)
|
||||
end
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
module Spree
|
||||
module AuthenticationHelpers
|
||||
def self.included(receiver)
|
||||
receiver.public_send :helper_method, :spree_current_user
|
||||
receiver.public_send :helper_method, :spree_login_path
|
||||
receiver.public_send :helper_method, :spree_logout_path
|
||||
receiver.helper_method :spree_current_user
|
||||
receiver.helper_method :spree_login_path
|
||||
receiver.helper_method :spree_logout_path
|
||||
end
|
||||
|
||||
def spree_current_user
|
||||
|
||||
@@ -75,7 +75,7 @@ end
|
||||
|
||||
module RswagExtension
|
||||
def param(args, &)
|
||||
public_send(:let, args) { instance_eval(&) }
|
||||
let(args) { instance_eval(&) }
|
||||
end
|
||||
end
|
||||
Rswag::Specs::ExampleGroupHelpers.prepend RswagExtension
|
||||
|
||||
Reference in New Issue
Block a user