mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:
committed by
GitHub
parent
f7907a3645
commit
666536cbd1
@@ -3,7 +3,7 @@
|
||||
# Support for ensure_{blah}! methods.
|
||||
module EnsureMagic
|
||||
def method_missing(method, *args, &block)
|
||||
if method.to_s =~ /^ensure_(.*)\!$/
|
||||
if method.to_s =~ /\Aensure_(.*)\!\z/
|
||||
can_method = :"#{Regexp.last_match[1]}?"
|
||||
|
||||
if respond_to?(can_method)
|
||||
|
||||
Reference in New Issue
Block a user