Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update active_storate_validations version, update validations

Mateusz Porębski35c87c2d2c61
diff --git a/core/app/models/spree/store_favicon_image.rb b/core/app/models/spree/store_favicon_image.rb
index f79605ebab..a036dfa22d 100644
--- a/core/app/models/spree/store_favicon_image.rb
+++ b/core/app/models/spree/store_favicon_image.rb
@@ -10,8 +10,17 @@ module Spree
validates :attachment,
content_type: VALID_CONTENT_TYPES,
- dimension: { max: 256..256 },
- aspect_ratio: :square,
size: { less_than_or_equal_to: 1.megabyte }
+
+ validates :attachment,
+ if: :is_png?,
+ dimension: { max: 256..256 },
+ aspect_ratio: :square
+
+ private
+
+ def is_png?
+ attachment.content_type.in?('image/png')
+ end
end
end
diff --git a/core/spree_core.gemspec b/core/spree_core.gemspec
index 460d5fadf6..cafc04a56e 100644
--- a/core/spree_core.gemspec
+++ b/core/spree_core.gemspec
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
s.add_dependency 'stringex'
s.add_dependency 'validates_zipcode'
s.add_dependency 'image_processing', '~> 1.2'
- s.add_dependency 'active_storage_validations', '~> 0.9', '<= 0.9.5'
+ s.add_dependency 'active_storage_validations', '~> 1.1.0'
s.add_dependency 'activerecord-typedstore'
s.add_dependency 'mobility', '~> 1.2.9'
s.add_dependency 'mobility-ransack', '~> 1.2.1'