From 1b95542a80fdea8733762b0ef15476296f82f358 Mon Sep 17 00:00:00 2001 From: Serhii Petrenko Date: Tue, 10 Oct 2023 15:24:08 +0300 Subject: [PATCH 1/4] Fix keyword arguments for ruby update --- lib/paperclip/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/schema.rb b/lib/paperclip/schema.rb index 40872d123..e290b0823 100644 --- a/lib/paperclip/schema.rb +++ b/lib/paperclip/schema.rb @@ -51,7 +51,7 @@ def attachment(*attachment_names) attachment_names.each do |attachment_name| COLUMNS.each_pair do |column_name, column_type| column_options = options.merge(options[column_name.to_sym] || {}) - column("#{attachment_name}_#{column_name}", column_type, column_options) + column("#{attachment_name}_#{column_name}", column_type, **column_options) end end end From f757cf01151eefa4337b0caab94f4dd2f3976ed3 Mon Sep 17 00:00:00 2001 From: Serhii Petrenko Date: Wed, 11 Oct 2023 14:21:38 +0300 Subject: [PATCH 2/4] Add version --- lib/paperclip/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/version.rb b/lib/paperclip/version.rb index 173e3cb4a..8c9d7bb1d 100644 --- a/lib/paperclip/version.rb +++ b/lib/paperclip/version.rb @@ -1,5 +1,5 @@ module Paperclip unless defined?(Paperclip::VERSION) - VERSION = "6.1.3".freeze + VERSION = "6.1.4".freeze end end From d5752105b38ba2fb2f1cf3a987ed87a00925e3d7 Mon Sep 17 00:00:00 2001 From: Serhii Petrenko Date: Wed, 11 Oct 2023 18:14:16 +0300 Subject: [PATCH 3/4] Fix mark_invalid method --- lib/paperclip/validators/attachment_content_type_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/validators/attachment_content_type_validator.rb b/lib/paperclip/validators/attachment_content_type_validator.rb index 532074a37..c30446970 100644 --- a/lib/paperclip/validators/attachment_content_type_validator.rb +++ b/lib/paperclip/validators/attachment_content_type_validator.rb @@ -40,7 +40,7 @@ def validate_blacklist(record, attribute, value) end def mark_invalid(record, attribute, types) - record.errors.add attribute, :invalid, options.merge(:types => types.join(', ')) + record.errors.add attribute, :invalid, **options.merge(:types => types.join(', ')) end def allowed_types From f62b720675bd76837be50aa55c8aa2314f67adb4 Mon Sep 17 00:00:00 2001 From: Serhii Petrenko Date: Thu, 12 Oct 2023 11:16:06 +0300 Subject: [PATCH 4/4] Fix attachment types --- lib/paperclip/validators/attachment_content_type_validator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/paperclip/validators/attachment_content_type_validator.rb b/lib/paperclip/validators/attachment_content_type_validator.rb index c30446970..6e0f15ea1 100644 --- a/lib/paperclip/validators/attachment_content_type_validator.rb +++ b/lib/paperclip/validators/attachment_content_type_validator.rb @@ -80,8 +80,8 @@ module HelperMethods # name +[attachment]_content_type+ to be able to use this validator. def validates_attachment_content_type(*attr_names) options = _merge_attributes(attr_names) - validates_with AttachmentContentTypeValidator, options.dup - validate_before_processing AttachmentContentTypeValidator, options.dup + validates_with AttachmentContentTypeValidator, **options.dup + validate_before_processing AttachmentContentTypeValidator, **options.dup end end end