mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
unnecessary checking of size
with second regex
if matched with first one
This commit is contained in:
parent
260471a5e1
commit
fff0309081
1 changed files with 5 additions and 2 deletions
|
@ -208,8 +208,11 @@ module ActionView
|
|||
end
|
||||
|
||||
if size = options.delete(:size)
|
||||
options[:width], options[:height] = size.split("x") if size =~ %r{\A\d+x\d+\z}
|
||||
options[:width] = options[:height] = size if size =~ %r{\A\d+\z}
|
||||
if size =~ %r{\A\d+x\d+\z}
|
||||
options[:width], options[:height] = size.split('x')
|
||||
elsif size =~ %r{\A\d+\z}
|
||||
options[:width] = options[:height] = size
|
||||
end
|
||||
end
|
||||
|
||||
tag("img", options)
|
||||
|
|
Loading…
Reference in a new issue