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 +4 -4
- data/app/models/concerns/spree/ransackable_attributes.rb +5 -0
- data/app/models/spree/calculator/free_shipping.rb +6 -5
- data/app/models/spree/product/scopes.rb +7 -3
- data/app/models/spree/product.rb +1 -0
- data/db/migrate/20130917024658_remove_promotions_event_name_field.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df21e1febf6c28c6c7fbe5f29457f33e1662bf7
|
4
|
+
data.tar.gz: 2b855fcc790eb5ed35eaf4c2ae34f023c1f38586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
190
|
-
|
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
|
data/app/models/spree/product.rb
CHANGED
@@ -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?
|
data/lib/spree/core/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|