spree_core 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/app_configuration.rb +0 -3
- data/app/models/spree/country.rb +4 -3
- data/app/models/spree/payment_method/check.rb +6 -4
- data/app/models/spree/product.rb +6 -2
- data/app/models/spree/product_property.rb +4 -4
- data/app/models/spree/state.rb +4 -3
- data/app/models/spree/stock/availability_validator.rb +8 -3
- data/app/models/spree/variant.rb +4 -0
- data/config/locales/en.yml +1 -1
- data/db/migrate/20141217215630_update_product_slug_index.rb +1 -1
- data/db/migrate/20150309161154_ensure_payments_have_numbers.rb +1 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +18 -18
- data/app/models/spree/alert.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e78e82569d33a57fc77a288f4bb6478a0fdf25
|
4
|
+
data.tar.gz: ec9e23165c2db5df7e0d0c58aa11d243fed18bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff1a688974b9cc46f3f4baecdc5212e3b6eb4ec6324cf47aeb29e1d8c50a2b1872635f9b3817b27a28f7cd5368fb7c10299e35e077ff7e9c9faadf6b6e8a2a34
|
7
|
+
data.tar.gz: 6cec5411da47ddfaf0504c2724dc866160d1443a021c3394e7b229745a469298396992d77a2b3cbfd98987efa1397d4999f53d09f7b742ee73676099d2feb222
|
@@ -31,15 +31,12 @@ module Spree
|
|
31
31
|
preference :auto_capture, :boolean, default: false # automatically capture the credit card (as opposed to just authorize and capture later)
|
32
32
|
preference :auto_capture_on_dispatch, :boolean, default: false # Captures payment for each shipment in Shipment#after_ship callback, and makes Shipment.ready when payment authorized.
|
33
33
|
preference :binary_inventory_cache, :boolean, default: false # only invalidate product cache when a stock item changes whether it is in_stock
|
34
|
-
preference :check_for_spree_alerts, :boolean, default: false
|
35
34
|
preference :checkout_zone, :string, default: nil # replace with the name of a zone if you would like to limit the countries
|
36
35
|
preference :company, :boolean, default: false # Request company field for billing and shipping addr
|
37
36
|
preference :currency, :string, default: "USD"
|
38
37
|
preference :default_country_id, :integer
|
39
|
-
preference :dismissed_spree_alerts, :string, default: ''
|
40
38
|
preference :expedited_exchanges, :boolean, default: false # NOTE this requires payment profiles to be supported on your gateway of choice as well as a delayed job handler to be configured with activejob. kicks off an exchange shipment upon return authorization save. charge customer if they do not return items within timely manner.
|
41
39
|
preference :expedited_exchanges_days_window, :integer, default: 14 # the amount of days the customer has to return their item after the expedited exchange is shipped in order to avoid being charged
|
42
|
-
preference :last_check_for_spree_alerts, :string, default: nil
|
43
40
|
preference :layout, :string, default: 'spree/layouts/spree_application'
|
44
41
|
preference :logo, :string, default: 'logo/spree_50.png'
|
45
42
|
preference :max_level_in_taxons_menu, :integer, default: 1 # maximum nesting level in taxons menu
|
data/app/models/spree/country.rb
CHANGED
@@ -4,9 +4,10 @@ module Spree
|
|
4
4
|
has_many :addresses, dependent: :nullify
|
5
5
|
|
6
6
|
has_many :zone_members,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
-> { where(zoneable_type: 'Spree::Country') },
|
8
|
+
class_name: 'Spree::ZoneMember',
|
9
|
+
dependent: :destroy,
|
10
|
+
foreign_key: :zoneable_id
|
10
11
|
|
11
12
|
has_many :zones, through: :zone_members, class_name: 'Spree::Zone'
|
12
13
|
|
@@ -14,13 +14,15 @@ module Spree
|
|
14
14
|
payment.state != 'void'
|
15
15
|
end
|
16
16
|
|
17
|
-
def capture(*
|
17
|
+
def capture(*)
|
18
18
|
simulated_successful_billing_response
|
19
19
|
end
|
20
20
|
|
21
|
-
def cancel(
|
21
|
+
def cancel(*)
|
22
|
+
simulated_successful_billing_response
|
23
|
+
end
|
22
24
|
|
23
|
-
def void(*
|
25
|
+
def void(*)
|
24
26
|
simulated_successful_billing_response
|
25
27
|
end
|
26
28
|
|
@@ -28,7 +30,7 @@ module Spree
|
|
28
30
|
false
|
29
31
|
end
|
30
32
|
|
31
|
-
def credit(*
|
33
|
+
def credit(*)
|
32
34
|
simulated_successful_billing_response
|
33
35
|
end
|
34
36
|
|
data/app/models/spree/product.rb
CHANGED
@@ -31,7 +31,7 @@ module Spree
|
|
31
31
|
has_many :properties, through: :product_properties
|
32
32
|
|
33
33
|
has_many :classifications, dependent: :delete_all, inverse_of: :product
|
34
|
-
has_many :taxons, through: :classifications
|
34
|
+
has_many :taxons, through: :classifications, before_remove: :remove_taxon
|
35
35
|
has_and_belongs_to_many :promotion_rules, join_table: :spree_products_promotion_rules
|
36
36
|
|
37
37
|
belongs_to :tax_category, class_name: 'Spree::TaxCategory'
|
@@ -100,7 +100,7 @@ module Spree
|
|
100
100
|
alias :options :product_option_types
|
101
101
|
|
102
102
|
self.whitelisted_ransackable_associations = %w[stores variants_including_master master variants]
|
103
|
-
self.whitelisted_ransackable_attributes = %w[slug]
|
103
|
+
self.whitelisted_ransackable_attributes = %w[description name slug]
|
104
104
|
|
105
105
|
# the master variant is not a member of the variants array
|
106
106
|
def has_variants?
|
@@ -351,6 +351,10 @@ module Spree
|
|
351
351
|
Spree::Taxonomy.where(id: taxonomy_ids).update_all(updated_at: Time.current)
|
352
352
|
end
|
353
353
|
|
354
|
+
def remove_taxon(taxon)
|
355
|
+
removed_classifications = classifications.where(taxon: taxon)
|
356
|
+
removed_classifications.each &:remove_from_list
|
357
|
+
end
|
354
358
|
end
|
355
359
|
end
|
356
360
|
|
@@ -19,10 +19,10 @@ module Spree
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def property_name=(name)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
if name.present?
|
23
|
+
# don't use `find_by :name` to workaround globalize/globalize#423 bug
|
24
|
+
property = Property.where(name: name).first ||
|
25
|
+
Property.create(name: name, presentation: name)
|
26
26
|
self.property = property
|
27
27
|
end
|
28
28
|
end
|
data/app/models/spree/state.rb
CHANGED
@@ -4,9 +4,10 @@ module Spree
|
|
4
4
|
has_many :addresses, dependent: :nullify
|
5
5
|
|
6
6
|
has_many :zone_members,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
-> { where(zoneable_type: 'Spree::State') },
|
8
|
+
class_name: 'Spree::ZoneMember',
|
9
|
+
dependent: :destroy,
|
10
|
+
foreign_key: :zoneable_id
|
10
11
|
|
11
12
|
has_many :zones, through: :zone_members, class_name: 'Spree::Zone'
|
12
13
|
|
@@ -4,12 +4,11 @@ module Spree
|
|
4
4
|
def validate(line_item)
|
5
5
|
unit_count = line_item.inventory_units.size
|
6
6
|
return if unit_count >= line_item.quantity
|
7
|
+
|
7
8
|
quantity = line_item.quantity - unit_count
|
8
9
|
return if quantity.zero?
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
return if quantifier.can_supply?(quantity)
|
11
|
+
return if item_available?(line_item, quantity)
|
13
12
|
|
14
13
|
variant = line_item.variant
|
15
14
|
display_name = "#{variant.name}"
|
@@ -20,6 +19,12 @@ module Spree
|
|
20
19
|
item: display_name.inspect
|
21
20
|
)
|
22
21
|
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def item_available?(line_item, quantity)
|
26
|
+
Stock::Quantifier.new(line_item.variant).can_supply?(quantity)
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
data/app/models/spree/variant.rb
CHANGED
data/config/locales/en.yml
CHANGED
@@ -513,7 +513,6 @@ en:
|
|
513
513
|
categories: Categories
|
514
514
|
category: Category
|
515
515
|
charged: Charged
|
516
|
-
check_for_spree_alerts: Check for Spree alerts
|
517
516
|
checkout: Checkout
|
518
517
|
choose_a_customer: Choose a customer
|
519
518
|
choose_a_taxon_to_sort_products_for: "Choose a taxon to sort products for"
|
@@ -616,6 +615,7 @@ en:
|
|
616
615
|
destination: Destination
|
617
616
|
destroy: Destroy
|
618
617
|
discount_amount: Discount Amount
|
618
|
+
discontinue_on: Discontinue On
|
619
619
|
dismiss_banner: No. Thanks! I'm not interested, do not display this message again
|
620
620
|
display: Display
|
621
621
|
doesnt_track_inventory: It doesn't track inventory
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class EnsurePaymentsHaveNumbers < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
+
add_index :spree_payments, :number unless index_exists?(:spree_payments, :number)
|
3
4
|
Spree::Payment.where(number: nil).find_each do |payment|
|
4
5
|
payment.generate_number
|
5
6
|
payment.update_columns(number: payment.number)
|
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.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.6.18
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: httparty
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0.11'
|
160
|
-
type: :runtime
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0.11'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: json
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,6 +338,20 @@ dependencies:
|
|
352
338
|
- - "~>"
|
353
339
|
- !ruby/object:Gem::Version
|
354
340
|
version: '3.0'
|
341
|
+
- !ruby/object:Gem::Dependency
|
342
|
+
name: sprockets-rails
|
343
|
+
requirement: !ruby/object:Gem::Requirement
|
344
|
+
requirements:
|
345
|
+
- - "~>"
|
346
|
+
- !ruby/object:Gem::Version
|
347
|
+
version: '2.0'
|
348
|
+
type: :runtime
|
349
|
+
prerelease: false
|
350
|
+
version_requirements: !ruby/object:Gem::Requirement
|
351
|
+
requirements:
|
352
|
+
- - "~>"
|
353
|
+
- !ruby/object:Gem::Version
|
354
|
+
version: '2.0'
|
355
355
|
- !ruby/object:Gem::Dependency
|
356
356
|
name: email_spec
|
357
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -404,7 +404,6 @@ files:
|
|
404
404
|
- app/models/spree/adjustable/adjustments_updater.rb
|
405
405
|
- app/models/spree/adjustable/promotion_accumulator.rb
|
406
406
|
- app/models/spree/adjustment.rb
|
407
|
-
- app/models/spree/alert.rb
|
408
407
|
- app/models/spree/app_configuration.rb
|
409
408
|
- app/models/spree/asset.rb
|
410
409
|
- app/models/spree/base.rb
|
@@ -922,8 +921,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
922
921
|
version: 1.8.23
|
923
922
|
requirements: []
|
924
923
|
rubyforge_project:
|
925
|
-
rubygems_version: 2.4.
|
924
|
+
rubygems_version: 2.4.6
|
926
925
|
signing_key:
|
927
926
|
specification_version: 4
|
928
927
|
summary: The bare bones necessary for Spree.
|
929
928
|
test_files: []
|
929
|
+
has_rdoc:
|
data/app/models/spree/alert.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'httparty'
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
class Alert
|
5
|
-
def self.current(host)
|
6
|
-
params = {
|
7
|
-
version: Spree.version,
|
8
|
-
name: Spree::Store.current.name,
|
9
|
-
host: host,
|
10
|
-
rails_env: Rails.env,
|
11
|
-
rails_version: Rails.version
|
12
|
-
}
|
13
|
-
|
14
|
-
HTTParty.get('http://alerts.spreecommerce.com/alerts.json', query: params).parsed_response
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|