diff options
author | Xavier Noria <fxn@hashref.com> | 2016-07-23 20:01:56 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-07-23 20:22:20 +0200 |
commit | 99cf7558000090668b137085bfe6bcc06c4571dc (patch) | |
tree | 33511db166bdbaa76ccd29a29daaf6bf343f149d /activerecord/test/cases/callbacks_test.rb | |
parent | 1ca571cc472ffea2dfab43ee57d8204e89d5b1a6 (diff) | |
download | rails-99cf7558000090668b137085bfe6bcc06c4571dc.tar.gz rails-99cf7558000090668b137085bfe6bcc06c4571dc.tar.bz2 rails-99cf7558000090668b137085bfe6bcc06c4571dc.zip |
systematic revision of =~ usage in AR
Where appropriatei, prefer the more concise Regexp#match?,
String#include?, String#start_with?, or String#end_with?
Diffstat (limited to 'activerecord/test/cases/callbacks_test.rb')
-rw-r--r-- | activerecord/test/cases/callbacks_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/callbacks_test.rb b/activerecord/test/cases/callbacks_test.rb index 4f70ae3a1d..8a722b4f22 100644 --- a/activerecord/test/cases/callbacks_test.rb +++ b/activerecord/test/cases/callbacks_test.rb @@ -31,7 +31,7 @@ class CallbackDeveloper < ActiveRecord::Base end ActiveRecord::Callbacks::CALLBACKS.each do |callback_method| - next if callback_method.to_s =~ /^around_/ + next if callback_method.to_s.start_with?('around_') define_callback_method(callback_method) ActiveSupport::Deprecation.silence { send(callback_method, callback_string(callback_method)) } send(callback_method, callback_proc(callback_method)) |