spree_core 3.2.0.rc1 → 3.2.0.rc2

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
  SHA1:
3
- metadata.gz: dc8d21681bc73e110e3d6e705da11f3dc39a53c0
4
- data.tar.gz: 9de82bfd2ca0d7c423c39cce5eab7efe902dfc58
3
+ metadata.gz: 9df21e1febf6c28c6c7fbe5f29457f33e1662bf7
4
+ data.tar.gz: 2b855fcc790eb5ed35eaf4c2ae34f023c1f38586
5
5
  SHA512:
6
- metadata.gz: aef6254d9ac18a5e56f5e4df41f2e024ad5a8d49ad8995781fd44f88a034fb2426e9f8de1c81dfb7dbe8720420b81eb4be3528cccaf084c0cce8bd7d401a3fee
7
- data.tar.gz: f7136d7ae86448f2a66b85a6b323b3536a9f474489ec8a3d36aac2e892d818b4153a22d0f24147a997aae21157c473dd6fad21e085061c2c8dedc539af15a07a
6
+ metadata.gz: 9872b3128e4d27049be36b7a83dcea10c77b04cca603c8d2b052683c4989cd863f904c5b195c574e52d5ad7cc2c5b5d9f253e61cc3c31ffb6221f2c085888111
7
+ data.tar.gz: efaa4550232d0d9bc5c7a4ccfd16e6b346e07fb2c276636e27d1e52875e9593369481f06eb1932dca4faa9fdaf52db49b9342d7357d1cd813eb73e1d454e8653
@@ -3,6 +3,7 @@ module Spree::RansackableAttributes
3
3
  included do
4
4
  class_attribute :whitelisted_ransackable_associations
5
5
  class_attribute :whitelisted_ransackable_attributes
6
+ class_attribute :whitelisted_ransackable_scopes
6
7
 
7
8
  class_attribute :default_ransackable_attributes
8
9
  self.default_ransackable_attributes = %w[id name updated_at created_at]
@@ -14,6 +15,10 @@ module Spree::RansackableAttributes
14
15
  def self.ransackable_attributes(*args)
15
16
  self.default_ransackable_attributes | (self.whitelisted_ransackable_attributes || [])
16
17
  end
18
+
19
+ def self.ransackable_scopes(*args)
20
+ whitelisted_ransackable_scopes || []
21
+ end
17
22
  end
18
23
 
19
24
  end
@@ -1,7 +1,3 @@
1
- # TODO: Deprecate this class.
2
- # This calculator will be removed in future versions of Spree.
3
- # The only case where it was used was for Free Shipping Promotions.
4
- # There is now a Promotion Action which deals with these types of promotions instead.
5
1
  module Spree
6
2
  class Calculator::FreeShipping < Calculator
7
3
  def self.description
@@ -9,6 +5,11 @@ module Spree
9
5
  end
10
6
 
11
7
  def compute(object)
8
+ ActiveSupport::Deprecation.warn(<<-EOS, caller)
9
+ Spree::Calculator::FreeShipping will be removed in Spree 3.3
10
+ The only case where it was used was for Free Shipping Promotions.
11
+ There is now a Promotion Action which deals with these types of promotions instead
12
+ EOS
12
13
  if object.is_a?(Array)
13
14
  return if object.empty?
14
15
  order = object.first.order
@@ -19,4 +20,4 @@ module Spree
19
20
  order.ship_total
20
21
  end
21
22
  end
22
- end
23
+ end
@@ -186,10 +186,14 @@ module Spree
186
186
  where("#{Product.quoted_table_name}.deleted_at IS NULL or #{Product.quoted_table_name}.deleted_at >= ?", Time.zone.now)
187
187
  end
188
188
 
189
- add_search_scope :not_discontinued do
190
- where("#{Product.quoted_table_name}.discontinue_on IS NULL or #{Product.quoted_table_name}.discontinue_on >= ?", Time.zone.now)
189
+ def self.not_discontinued(only_not_discontinued = true)
190
+ if only_not_discontinued != '0' && only_not_discontinued
191
+ where("#{Product.quoted_table_name}.discontinue_on IS NULL or #{Product.quoted_table_name}.discontinue_on >= ?", Time.zone.now)
192
+ else
193
+ all
194
+ end
191
195
  end
192
-
196
+ search_scopes << :not_discontinued
193
197
  # Can't use add_search_scope for this as it needs a default argument
194
198
  def self.available(available_on = nil, currency = nil)
195
199
  available_on ||= Time.current
@@ -116,6 +116,7 @@ module Spree
116
116
 
117
117
  self.whitelisted_ransackable_associations = %w[stores variants_including_master master variants]
118
118
  self.whitelisted_ransackable_attributes = %w[description name slug discontinue_on]
119
+ self.whitelisted_ransackable_scopes = %w[not_discontinued]
119
120
 
120
121
  # the master variant is not a member of the variants array
121
122
  def has_variants?
@@ -1,5 +1,5 @@
1
1
  class RemovePromotionsEventNameField < ActiveRecord::Migration[4.2]
2
2
  def change
3
- remove_column :spree_promotions, :event_name
3
+ remove_column :spree_promotions, :event_name, :string
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.2.0.rc1"
3
+ "3.2.0.rc2"
4
4
  end
5
5
  end
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.2.0.rc1
4
+ version: 3.2.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant