spree_core 3.6.0.rc1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/spree/image/configuration/active_storage.rb +7 -1
- data/app/models/spree/taxon.rb +1 -0
- data/app/models/spree/taxon_icon/configuration/active_storage.rb +10 -1
- data/app/models/spree/taxon_icon/configuration/paperclip.rb +2 -0
- data/config/initializers/use_paperclip.rb +1 -1
- data/config/locales/en.yml +4 -0
- data/lib/spree/core/engine.rb +3 -3
- data/lib/spree/core/version.rb +1 -1
- data/spree_core.gemspec +1 -1
- metadata +4 -5
- data/app/models/concerns/spree/attachment_validation.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f1c2be6be02be7358b264b3e1348773dc1bf3e55ab97a86859ba4a4f9c0d77
|
4
|
+
data.tar.gz: 7771528437b9fe095548206692af4bd7d8ebb1bb0fa43582fc983b9afe0e5854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86217abb1a7a7dc22e57e725bea6c48f613eafb603228c21242ef602b4bff113dc90b1824c5f2b6ccad263662e03b7963d8fc4bd0b138f735543e974d385f369
|
7
|
+
data.tar.gz: 57afdf87e4bdb190a23256692f773071c0f476b08994e2f45f7d565f178592493ce16af70f5ef4dabdf5c4a85f9297a4e9d147349835b1b0c30a1d854d144df1
|
@@ -3,7 +3,6 @@ module Spree
|
|
3
3
|
module Configuration
|
4
4
|
module ActiveStorage
|
5
5
|
extend ActiveSupport::Concern
|
6
|
-
include ::Spree::AttachmentValidation
|
7
6
|
|
8
7
|
included do
|
9
8
|
validate :check_attachment_presence
|
@@ -34,6 +33,13 @@ module Spree
|
|
34
33
|
errors.add(:attachment, :attachment_must_be_present)
|
35
34
|
end
|
36
35
|
end
|
36
|
+
|
37
|
+
def check_attachment_content_type
|
38
|
+
if attachment.attached? && !attachment.content_type.in?(accepted_image_types)
|
39
|
+
attachment.purge
|
40
|
+
errors.add(:attachment, :not_allowed_content_type)
|
41
|
+
end
|
42
|
+
end
|
37
43
|
end
|
38
44
|
end
|
39
45
|
end
|
data/app/models/spree/taxon.rb
CHANGED
@@ -21,6 +21,7 @@ module Spree
|
|
21
21
|
|
22
22
|
validates :name, presence: true, uniqueness: { scope: [:parent_id, :taxonomy_id], allow_blank: true }
|
23
23
|
validates :permalink, uniqueness: { case_sensitive: false }
|
24
|
+
validates_associated :icon
|
24
25
|
validate :check_for_root, on: :create
|
25
26
|
with_options length: { maximum: 255 }, allow_blank: true do
|
26
27
|
validates :meta_keywords
|
@@ -3,7 +3,6 @@ module Spree
|
|
3
3
|
module Configuration
|
4
4
|
module ActiveStorage
|
5
5
|
extend ActiveSupport::Concern
|
6
|
-
include Spree::AttachmentValidation
|
7
6
|
|
8
7
|
included do
|
9
8
|
validate :check_attachment_content_type
|
@@ -20,6 +19,16 @@ module Spree
|
|
20
19
|
def default_style
|
21
20
|
:mini
|
22
21
|
end
|
22
|
+
|
23
|
+
def accepted_image_types
|
24
|
+
%w(image/jpeg image/jpg image/png image/gif)
|
25
|
+
end
|
26
|
+
|
27
|
+
def check_attachment_content_type
|
28
|
+
if attachment.attached? && !attachment.content_type.in?(accepted_image_types)
|
29
|
+
errors.add(:attachment, :not_allowed_content_type)
|
30
|
+
end
|
31
|
+
end
|
23
32
|
end
|
24
33
|
end
|
25
34
|
end
|
data/config/locales/en.yml
CHANGED
@@ -366,6 +366,10 @@ en:
|
|
366
366
|
attachment:
|
367
367
|
not_allowed_content_type: has not allowed content type
|
368
368
|
attachment_must_be_present: must be present
|
369
|
+
spree/taxon_icon:
|
370
|
+
attributes:
|
371
|
+
attachment:
|
372
|
+
not_allowed_content_type: has not allowed content type
|
369
373
|
devise:
|
370
374
|
confirmations:
|
371
375
|
confirmed: Your account was successfully confirmed. You are now signed in.
|
data/lib/spree/core/engine.rb
CHANGED
@@ -116,12 +116,12 @@ module Spree
|
|
116
116
|
end
|
117
117
|
|
118
118
|
config.to_prepare do
|
119
|
-
#
|
120
|
-
I18n.load_path
|
119
|
+
# Ensure spree locale paths are present before decorators
|
120
|
+
I18n.load_path.unshift(*(Dir.glob(
|
121
121
|
File.join(
|
122
122
|
File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
|
123
123
|
)
|
124
|
-
)
|
124
|
+
) - I18n.load_path))
|
125
125
|
|
126
126
|
# Load application's model / class decorators
|
127
127
|
Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
|
data/lib/spree/core/version.rb
CHANGED
data/spree_core.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_dependency 'highline', '~> 1.6.18' # Necessary for the install generator
|
32
32
|
s.add_dependency 'kaminari', '~> 1.0.1'
|
33
33
|
s.add_dependency 'monetize', '~> 1.1'
|
34
|
-
s.add_dependency 'paperclip', '~>
|
34
|
+
s.add_dependency 'paperclip', '~> 6.0.0'
|
35
35
|
s.add_dependency 'paranoia', '~> 2.4.1'
|
36
36
|
s.add_dependency 'premailer-rails'
|
37
37
|
s.add_dependency 'acts-as-taggable-on', '~> 5.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.0
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 6.0.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 6.0.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: paranoia
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -371,7 +371,6 @@ files:
|
|
371
371
|
- app/mailers/spree/test_mailer.rb
|
372
372
|
- app/models/concerns/spree/acts_as_taggable.rb
|
373
373
|
- app/models/concerns/spree/adjustment_source.rb
|
374
|
-
- app/models/concerns/spree/attachment_validation.rb
|
375
374
|
- app/models/concerns/spree/calculated_adjustments.rb
|
376
375
|
- app/models/concerns/spree/default_price.rb
|
377
376
|
- app/models/concerns/spree/display_money.rb
|