Skip to content

Commit d3273a3

Browse files
Remove JFIF hack from #343
Not needed since libvips/libvips#3775 was fixed
1 parent fef0e38 commit d3273a3

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

app/models/hackathon/branded.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,5 @@ module Hackathon::Branded
1515

1616
validates :logo, :banner, on: :submit, attached: true,
1717
size: {less_than: 25.megabytes, message: "is too powerful (max 25 MB)"}
18-
19-
before_validation :jfif_to_jpeg, if: -> { attachment_changes.any? }, on: :create
20-
end
21-
22-
private
23-
24-
def jfif_to_jpeg
25-
logo&.blob&.filename = logo&.blob&.filename&.to_s&.gsub(/\.jfif\z/i, ".jpeg")
26-
banner&.blob&.filename = banner&.blob&.filename&.to_s&.gsub(/\.jfif\z/i, ".jpeg")
2718
end
2819
end

test/models/hackathon_test.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class HackathonTest < ActiveSupport::TestCase
7373

7474
assert @hackathon.save
7575

76-
assert_equal "assemble_logo.jpeg", @hackathon.logo.blob.filename.to_s
77-
assert_equal "assemble.jpeg", @hackathon.banner.blob.filename.to_s
76+
assert @hackathon.logo.variant(:small).processed
77+
assert @hackathon.banner.variant(:small).processed
78+
assert @hackathon.banner.variant(:large).processed
7879
end
7980
end

0 commit comments

Comments
 (0)