spree_core 3.0.0.rc4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/mailers/spree/base_mailer.rb +1 -1
- data/app/models/concerns/spree/number_generator.rb +1 -1
- data/app/models/spree/app_configuration.rb +0 -1
- data/app/models/spree/option_type.rb +2 -0
- data/app/models/spree/promotion.rb +2 -2
- data/app/models/spree/refund.rb +5 -0
- data/app/models/spree/zone_member.rb +0 -5
- data/config/initializers/user_class_extensions.rb +1 -0
- data/db/migrate/20150309161154_ensure_payments_have_numbers.rb +8 -0
- data/lib/spree/core/controller_helpers/order.rb +0 -5
- data/lib/spree/core/controller_helpers/store.rb +7 -4
- data/lib/spree/core/search/base.rb +5 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/order_walkthrough.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3affc0ac5855ce03665194985d21e1bf01bcda44
|
4
|
+
data.tar.gz: ad8218d37fb42edea1f6e34e0554fced3aa4758b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac94f550dc92e07f5ecbdefe2151853b8f7963ecf5378bcc61bccc6cb47063792185175041551ff301f810100a4f43873480b0d9d75673f1ad3376532e0ac65
|
7
|
+
data.tar.gz: 60c7dd641591eaaf0f80bcb48d8fb169fb9e150fe31e87705f3a537a13d107826bb2138ea3019d6f97ba3ebe63c682873a62e3e34e60c3be0b6d58e59e1ca071
|
@@ -61,7 +61,6 @@ module Spree
|
|
61
61
|
|
62
62
|
# Default mail headers settings
|
63
63
|
preference :send_core_emails, :boolean, default: true
|
64
|
-
preference :mails_from, :string, default: 'spree@example.com'
|
65
64
|
|
66
65
|
# searcher_class allows spree extension writers to provide their own Search class
|
67
66
|
def searcher_class
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
class OptionType < Spree::Base
|
3
|
+
acts_as_list
|
4
|
+
|
3
5
|
has_many :option_values, -> { order(:position) }, dependent: :destroy, inverse_of: :option_type
|
4
6
|
has_many :product_option_types, dependent: :destroy, inverse_of: :option_type
|
5
7
|
has_many :products, through: :product_option_types
|
@@ -41,8 +41,8 @@ module Spree
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.active
|
44
|
-
where('starts_at IS NULL OR starts_at < ?', Time.now).
|
45
|
-
where('expires_at IS NULL OR expires_at > ?', Time.now)
|
44
|
+
where('spree_promotions.starts_at IS NULL OR spree_promotions.starts_at < ?', Time.now).
|
45
|
+
where('spree_promotions.expires_at IS NULL OR spree_promotions.expires_at > ?', Time.now)
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.order_activatable?(order)
|
data/app/models/spree/refund.rb
CHANGED
@@ -46,6 +46,7 @@ module Spree
|
|
46
46
|
|
47
47
|
self.transaction_id = @response.authorization
|
48
48
|
update_columns(transaction_id: transaction_id)
|
49
|
+
update_order
|
49
50
|
end
|
50
51
|
|
51
52
|
# return an activemerchant response object if successful or else raise an error
|
@@ -77,5 +78,9 @@ module Spree
|
|
77
78
|
errors.add(:amount, :greater_than_allowed)
|
78
79
|
end
|
79
80
|
end
|
81
|
+
|
82
|
+
def update_order
|
83
|
+
payment.order.updater.update
|
84
|
+
end
|
80
85
|
end
|
81
86
|
end
|
@@ -7,7 +7,6 @@ module Spree
|
|
7
7
|
included do
|
8
8
|
before_filter :set_current_order
|
9
9
|
|
10
|
-
helper_method :current_currency
|
11
10
|
helper_method :current_order
|
12
11
|
helper_method :simple_current_order
|
13
12
|
end
|
@@ -64,10 +63,6 @@ module Spree
|
|
64
63
|
end
|
65
64
|
end
|
66
65
|
|
67
|
-
def current_currency
|
68
|
-
Spree::Config[:currency]
|
69
|
-
end
|
70
|
-
|
71
66
|
def ip_address
|
72
67
|
request.remote_ip
|
73
68
|
end
|
@@ -5,14 +5,17 @@ module Spree
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
9
|
-
def current_store
|
10
|
-
@current_store ||= Spree::Store.current(request.env['SERVER_NAME'])
|
11
|
-
end
|
8
|
+
helper_method :current_currency
|
12
9
|
helper_method :current_store
|
10
|
+
end
|
13
11
|
|
12
|
+
def current_currency
|
13
|
+
Spree::Config[:currency]
|
14
14
|
end
|
15
15
|
|
16
|
+
def current_store
|
17
|
+
@current_store ||= Spree::Store.current(request.env['SERVER_NAME'])
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -89,7 +89,11 @@ module Spree
|
|
89
89
|
|
90
90
|
per_page = params[:per_page].to_i
|
91
91
|
@properties[:per_page] = per_page > 0 ? per_page : Spree::Config[:products_per_page]
|
92
|
-
|
92
|
+
if params[:page].respond_to?(:to_i)
|
93
|
+
@properties[:page] = (params[:page].to_i <= 0) ? 1 : params[:page].to_i
|
94
|
+
else
|
95
|
+
@properties[:page] = 1
|
96
|
+
end
|
93
97
|
end
|
94
98
|
end
|
95
99
|
end
|
data/lib/spree/core/version.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
class OrderWalkthrough
|
2
2
|
def self.up_to(state)
|
3
|
+
# A default store must exist to provide store settings
|
4
|
+
unless Spree::Store.exists?
|
5
|
+
FactoryGirl.create(:store)
|
6
|
+
end
|
7
|
+
|
3
8
|
# A payment method must exist for an order to proceed through the Address state
|
4
9
|
unless Spree::PaymentMethod.exists?
|
5
10
|
FactoryGirl.create(:check_payment_method)
|
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.0
|
4
|
+
version: 3.0.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: 2015-03-
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -775,6 +775,7 @@ files:
|
|
775
775
|
- db/migrate/20150128032538_remove_environment_from_tracker.rb
|
776
776
|
- db/migrate/20150128060325_remove_spree_configurations.rb
|
777
777
|
- db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb
|
778
|
+
- db/migrate/20150309161154_ensure_payments_have_numbers.rb
|
778
779
|
- db/seeds.rb
|
779
780
|
- lib/generators/spree/custom_user/custom_user_generator.rb
|
780
781
|
- lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt
|