spree_core 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/spree/admin/base_controller.rb +4 -0
- data/app/controllers/spree/admin/resource_controller.rb +1 -0
- data/app/models/spree/preference.rb +1 -1
- data/app/models/spree/return_authorization.rb +1 -1
- data/app/views/spree/admin/shared/_address_form.html.erb +2 -1
- data/config/locales/en.yml +1 -1
- data/lib/spree/core/engine.rb +1 -1
- data/lib/spree/core/testing_support/factories/order_factory.rb +10 -0
- data/lib/spree/core/testing_support/factories/variant_factory.rb +1 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +29 -29
@@ -1,10 +1,14 @@
|
|
1
1
|
module Spree
|
2
2
|
module Admin
|
3
3
|
class BaseController < Spree::BaseController
|
4
|
+
ssl_required
|
5
|
+
|
4
6
|
helper 'spree/search'
|
5
7
|
helper 'spree/admin/navigation'
|
6
8
|
layout '/spree/layouts/admin'
|
7
9
|
|
10
|
+
before_filter :check_alerts unless Rails.env.development?
|
11
|
+
|
8
12
|
protected
|
9
13
|
def check_alerts
|
10
14
|
return unless current_user and should_check_alerts?
|
@@ -4,6 +4,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
4
4
|
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
|
5
5
|
prepend_before_filter :load_resource
|
6
6
|
rescue_from ActiveRecord::RecordNotFound, :with => :resource_not_found
|
7
|
+
rescue_from CanCan::AccessDenied, :with => :unauthorized
|
7
8
|
|
8
9
|
respond_to :html
|
9
10
|
respond_to :js, :except => [:show, :index]
|
@@ -65,7 +65,7 @@ module Spree
|
|
65
65
|
|
66
66
|
def process_return
|
67
67
|
inventory_units.each &:return!
|
68
|
-
credit = Adjustment.create(:source => self, :
|
68
|
+
credit = Adjustment.create(:source => self, :adjustable => order, :amount => self.amount.abs * -1, :label => I18n.t(:rma_credit))
|
69
69
|
self.order.update!
|
70
70
|
end
|
71
71
|
|
@@ -5,7 +5,8 @@
|
|
5
5
|
<%= name %>
|
6
6
|
<span class="right">
|
7
7
|
<% if use_billing %>
|
8
|
-
<%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.eql?(@order.ship_address)) %>
|
8
|
+
<%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.eql?(@order.ship_address)) %>
|
9
|
+
<%= label_tag 'order[use_billing]', t(:use_billing_address) %>
|
9
10
|
<% end %>
|
10
11
|
</span>
|
11
12
|
</th>
|
data/config/locales/en.yml
CHANGED
@@ -284,7 +284,7 @@ en:
|
|
284
284
|
cancel_my_account: Cancel my account
|
285
285
|
cancel_my_account_description: "Unhappy?"
|
286
286
|
canceled: Canceled
|
287
|
-
cannot_create_returns: Cannot create returns as this order no shipped units.
|
287
|
+
cannot_create_returns: Cannot create returns as this order has no shipped units.
|
288
288
|
cannot_perform_operation: "Cannot perform requested operation"
|
289
289
|
capture: Capture
|
290
290
|
card_code: "Card Code"
|
data/lib/spree/core/engine.rb
CHANGED
@@ -71,7 +71,7 @@ module Spree
|
|
71
71
|
|
72
72
|
# sets the manifests / assets to be precompiled
|
73
73
|
initializer "spree.assets.precompile" do |app|
|
74
|
-
app.config.assets.precompile += ['store/all.*', 'admin/all.*', 'admin/orders/edit_form.js', 'admin/
|
74
|
+
app.config.assets.precompile += ['store/all.*', 'admin/all.*', 'admin/orders/edit_form.js', 'admin/address_states.js', 'jqPlot/excanvas.min.js', 'admin/images/new.js', 'jquery.jstree/themes/apple/*']
|
75
75
|
end
|
76
76
|
|
77
77
|
initializer "spree.asset.pipeline" do |app|
|
@@ -19,4 +19,14 @@ FactoryGirl.define do
|
|
19
19
|
Factory(:inventory_unit, :order => order, :state => 'shipped')
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
factory :completed_order_with_totals, :parent => :order_with_totals do
|
24
|
+
bill_address { Factory(:address) }
|
25
|
+
ship_address { Factory(:address) }
|
26
|
+
after_create do |order|
|
27
|
+
Factory(:inventory_unit, :order => order, :state => 'shipped')
|
28
|
+
end
|
29
|
+
state 'complete'
|
30
|
+
completed_at Time.now
|
31
|
+
end
|
22
32
|
end
|
data/lib/spree/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: acts_as_list
|
16
|
-
requirement: &
|
16
|
+
requirement: &70356948181000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.1.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70356948181000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nested_set
|
27
|
-
requirement: &
|
27
|
+
requirement: &70356948179640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.8
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70356948179640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jquery-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70356947444680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: 1.0.19
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70356947444680
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: highline
|
52
|
-
requirement: &
|
52
|
+
requirement: &70356947442220 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - =
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: 1.6.8
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70356947442220
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: state_machine
|
63
|
-
requirement: &
|
63
|
+
requirement: &70356947440240 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - =
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: 1.1.1
|
69
69
|
type: :runtime
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *70356947440240
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: ffaker
|
74
|
-
requirement: &
|
74
|
+
requirement: &70356947438620 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
@@ -79,10 +79,10 @@ dependencies:
|
|
79
79
|
version: 1.12.0
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *70356947438620
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: paperclip
|
85
|
-
requirement: &
|
85
|
+
requirement: &70356947452740 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - =
|
@@ -90,10 +90,10 @@ dependencies:
|
|
90
90
|
version: 2.5.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *70356947452740
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: meta_search
|
96
|
-
requirement: &
|
96
|
+
requirement: &70356947451720 !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
99
|
- - =
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
version: 1.1.1
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70356947451720
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: activemerchant
|
107
|
-
requirement: &
|
107
|
+
requirement: &70356947450920 !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
110
110
|
- - =
|
@@ -112,10 +112,10 @@ dependencies:
|
|
112
112
|
version: 1.20.1
|
113
113
|
type: :runtime
|
114
114
|
prerelease: false
|
115
|
-
version_requirements: *
|
115
|
+
version_requirements: *70356947450920
|
116
116
|
- !ruby/object:Gem::Dependency
|
117
117
|
name: rails
|
118
|
-
requirement: &
|
118
|
+
requirement: &70356947449720 !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
121
121
|
- - ! '>='
|
@@ -126,10 +126,10 @@ dependencies:
|
|
126
126
|
version: 3.1.4
|
127
127
|
type: :runtime
|
128
128
|
prerelease: false
|
129
|
-
version_requirements: *
|
129
|
+
version_requirements: *70356947449720
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
131
|
name: kaminari
|
132
|
-
requirement: &
|
132
|
+
requirement: &70356947447900 !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
134
134
|
requirements:
|
135
135
|
- - ! '>='
|
@@ -137,10 +137,10 @@ dependencies:
|
|
137
137
|
version: 0.13.0
|
138
138
|
type: :runtime
|
139
139
|
prerelease: false
|
140
|
-
version_requirements: *
|
140
|
+
version_requirements: *70356947447900
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: deface
|
143
|
-
requirement: &
|
143
|
+
requirement: &70356947446980 !ruby/object:Gem::Requirement
|
144
144
|
none: false
|
145
145
|
requirements:
|
146
146
|
- - ! '>='
|
@@ -148,10 +148,10 @@ dependencies:
|
|
148
148
|
version: 0.7.2
|
149
149
|
type: :runtime
|
150
150
|
prerelease: false
|
151
|
-
version_requirements: *
|
151
|
+
version_requirements: *70356947446980
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: stringex
|
154
|
-
requirement: &
|
154
|
+
requirement: &70356947445860 !ruby/object:Gem::Requirement
|
155
155
|
none: false
|
156
156
|
requirements:
|
157
157
|
- - ~>
|
@@ -159,7 +159,7 @@ dependencies:
|
|
159
159
|
version: 1.3.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
|
-
version_requirements: *
|
162
|
+
version_requirements: *70356947445860
|
163
163
|
description: Required dependency for Spree
|
164
164
|
email: sean@spreecommerce.com
|
165
165
|
executables: []
|
@@ -973,7 +973,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
973
973
|
version: '0'
|
974
974
|
segments:
|
975
975
|
- 0
|
976
|
-
hash:
|
976
|
+
hash: -2957388299349255017
|
977
977
|
requirements:
|
978
978
|
- none
|
979
979
|
rubyforge_project: spree_core
|