Use String#+@ before mutating the result of Symbol#to_s

This commit is contained in:
David Rodríguez 2019-10-13 16:31:56 +02:00
parent ffc4e6c17c
commit c43419b5b9
No known key found for this signature in database
GPG Key ID: 1008A258BB37309C
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ module Ransack
alias :g= :groupings=
def method_missing(method_id, *args)
method_name = method_id.to_s.dup
method_name = +method_id.to_s
writer = method_name.sub!(/\=$/, ''.freeze)
if attribute_method?(method_name)
if writer