spree_core 3.6.0.rc1 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3a62997dc364cc3ebb70bbb5ff1bffd6c663e0bce92f21ee0f8a1c6680f6c4c
4
- data.tar.gz: 261701f37b5fd2f42ee790eb5f857be8cd23929d037d85ebd3c7251958f8c67a
3
+ metadata.gz: b1f1c2be6be02be7358b264b3e1348773dc1bf3e55ab97a86859ba4a4f9c0d77
4
+ data.tar.gz: 7771528437b9fe095548206692af4bd7d8ebb1bb0fa43582fc983b9afe0e5854
5
5
  SHA512:
6
- metadata.gz: 1b7fe5bd4de04b1958a76e81c82ebb56c36fa20fa3e8b0152533aa1d19f6695269366a5e620911bf3fb06b769e5fe816a53785a664b3c68f17744b475334fbe0
7
- data.tar.gz: 509928ad83be2095dfd50ef8d7d62fff6309801b796ce41b0b0ea2de0efd8c8832fb85d81467bcc58bb46cced38b6faab44514fae9cb8fc2ef8b22b2371b5e8c
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
@@ -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
@@ -9,6 +9,8 @@ module Spree
9
9
  attachment_definitions[:attachment][:styles]
10
10
  end
11
11
 
12
+ delegate :url, to: :attachment
13
+
12
14
  has_attached_file :attachment,
13
15
  styles: { mini: '32x32>', normal: '128x128>' },
14
16
  default_style: :mini,
@@ -1,3 +1,3 @@
1
1
  Rails.application.configure do
2
- config.use_paperclip = ActiveModel::Type::Boolean.new.cast ENV['USE_PAPERCLIP']
2
+ config.use_paperclip = ActiveModel::Type::Boolean.new.cast ENV['SPREE_USE_PAPERCLIP']
3
3
  end
@@ -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.
@@ -116,12 +116,12 @@ module Spree
116
116
  end
117
117
 
118
118
  config.to_prepare do
119
- # Load spree locales before decorators
120
- I18n.load_path += Dir.glob(
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|
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- '3.6.0.rc1'
3
+ '3.6.0'
4
4
  end
5
5
  end
@@ -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', '~> 5.2.0'
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.rc1
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-05-28 00:00:00.000000000 Z
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: 5.2.0
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: 5.2.0
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
@@ -1,10 +0,0 @@
1
- module Spree
2
- module AttachmentValidation
3
- def check_attachment_content_type
4
- if attachment.attached? && !attachment.content_type.in?(accepted_image_types)
5
- attachment.purge
6
- errors.add(:attachment, :not_allowed_content_type)
7
- end
8
- end
9
- end
10
- end