diff options
author | Akira Matsuda <ronnie@dio.jp> | 2019-07-29 14:23:10 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2019-07-29 14:23:10 +0900 |
commit | 0196551e6039ca864d1eee1e01819fcae12c1dc9 (patch) | |
tree | 899db0e49063164697a005bca64fc5b06c2a2cfc /actiontext/lib | |
parent | 0d981a2b3d26958f19e0613db8e5f480a34dd8fc (diff) | |
download | rails-0196551e6039ca864d1eee1e01819fcae12c1dc9.tar.gz rails-0196551e6039ca864d1eee1e01819fcae12c1dc9.tar.bz2 rails-0196551e6039ca864d1eee1e01819fcae12c1dc9.zip |
Use match? where we don't need MatchData
Diffstat (limited to 'actiontext/lib')
-rw-r--r-- | actiontext/lib/action_text/attachables/remote_image.rb | 2 | ||||
-rw-r--r-- | actiontext/lib/action_text/attachment_gallery.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actiontext/lib/action_text/attachables/remote_image.rb b/actiontext/lib/action_text/attachables/remote_image.rb index 650b11862b..c5819ef1f5 100644 --- a/actiontext/lib/action_text/attachables/remote_image.rb +++ b/actiontext/lib/action_text/attachables/remote_image.rb @@ -14,7 +14,7 @@ module ActionText private def content_type_is_image?(content_type) - content_type.to_s =~ /^image(\/.+|$)/ + content_type.to_s.match?(/^image(\/.+|$)/) end def attributes_from_node(node) diff --git a/actiontext/lib/action_text/attachment_gallery.rb b/actiontext/lib/action_text/attachment_gallery.rb index 45afbff058..48ba9f830c 100644 --- a/actiontext/lib/action_text/attachment_gallery.rb +++ b/actiontext/lib/action_text/attachment_gallery.rb @@ -23,7 +23,7 @@ module ActionText Fragment.wrap(content).find_all(SELECTOR).select do |node| node.children.all? do |child| if child.text? - child.text =~ /\A(\n|\ )*\z/ + /\A(\n|\ )*\z/.match?(child.text) else child.matches? ATTACHMENT_SELECTOR end |