Skip to content

Commit

Permalink
Avoid creating multiple regexp objects
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed May 14, 2024
1 parent ae12516 commit 3901880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/simple_form/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def attempt_mapping(mapping, at)
begin
at.const_get(mapping)
rescue NameError => e
raise if e.message !~ /#{mapping}$/
raise unless e.message.end_with?(mapping)
end
end

Expand Down

0 comments on commit 3901880

Please sign in to comment.