Skip to content

Commit

Permalink
Restore support to ruby 2.3, add ruby 2.3 to circle ci (#7935)
Browse files Browse the repository at this point in the history
This replace calls of String#match? with rails Regex#match?
This follows the same idea used to keep Rails 5.2 compatible with Ruby
2.2.2 in rails/rails#32973
  • Loading branch information
renatolond authored and Gargron committed Jul 3, 2018
1 parent bbbe3ed commit 4045b50
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Expand Up @@ -110,6 +110,13 @@ jobs:
environment: *ruby_environment
<<: *install_ruby_dependencies

install-ruby2.3:
<<: *defaults
docker:
- image: circleci/ruby:2.3.7-stretch-node
environment: *ruby_environment
<<: *install_ruby_dependencies

build:
<<: *defaults
steps:
Expand Down Expand Up @@ -146,6 +153,17 @@ jobs:
- image: circleci/redis:4.0.9-alpine
<<: *test_steps

test-ruby2.3:
<<: *defaults
docker:
- image: circleci/ruby:2.3.7-stretch-node
environment: *ruby_environment
- image: circleci/postgres:10.3-alpine
environment:
POSTGRES_USER: root
- image: circleci/redis:4.0.9-alpine
<<: *test_steps

test-webui:
<<: *defaults
docker:
Expand Down Expand Up @@ -174,6 +192,9 @@ workflows:
- install-ruby2.4:
requires:
- install
- install-ruby2.3:
requires:
- install
- build:
requires:
- install-ruby2.5
Expand All @@ -185,6 +206,10 @@ workflows:
requires:
- install-ruby2.4
- build
- test-ruby2.3:
requires:
- install-ruby2.3
- build
- test-webui:
requires:
- install
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/attachmentable.rb
Expand Up @@ -28,7 +28,7 @@ def check_image_dimensions
self.class.attachment_definitions.each_key do |attachment_name|
attachment = send(attachment_name)

next if attachment.blank? || !attachment.content_type.match?(/image.*/) || attachment.queued_for_write[:original].blank?
next if attachment.blank? || !/image.*/.match?(attachment.content_type) || attachment.queued_for_write[:original].blank?

width, height = FastImage.size(attachment.queued_for_write[:original].path)

Expand Down

0 comments on commit 4045b50

Please sign in to comment.