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.
@@ -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]
@@ -19,7 +19,7 @@ class Spree::Preference < ActiveRecord::Base
19
19
  when :integer
20
20
  self[:value].to_i
21
21
  when :boolean
22
- (self[:value].to_s =~ /^t/i) != nil
22
+ (self[:value].to_s =~ /^[t|1]/i) != nil
23
23
  end
24
24
  else
25
25
  self[:value]
@@ -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, :order_id => self.order.id, :amount => self.amount.abs * -1, :label => I18n.t(:rma_credit))
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)) %> <%= t(:use_billing_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>
@@ -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"
@@ -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/orders/address_states.js', 'jqPlot/excanvas.min.js', 'admin/images/new.js', 'jquery.jstree/themes/apple/*']
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
@@ -7,6 +7,7 @@ FactoryGirl.define do
7
7
  height { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
8
8
  width { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
9
9
  depth { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
10
+ on_hand 5
10
11
 
11
12
  # associations:
12
13
  product { |p| p.association(:product) }
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "1.0.1"
3
+ "1.0.2"
4
4
  end
5
5
  end
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.1
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-04 00:00:00.000000000 Z
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: &70264868578960 !ruby/object:Gem::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: *70264868578960
24
+ version_requirements: *70356948181000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nested_set
27
- requirement: &70264868605240 !ruby/object:Gem::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: *70264868605240
35
+ version_requirements: *70356948179640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jquery-rails
38
- requirement: &70264868603300 !ruby/object:Gem::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: *70264868603300
49
+ version_requirements: *70356947444680
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: highline
52
- requirement: &70264868601820 !ruby/object:Gem::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: *70264868601820
60
+ version_requirements: *70356947442220
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: state_machine
63
- requirement: &70264868601240 !ruby/object:Gem::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: *70264868601240
71
+ version_requirements: *70356947440240
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: ffaker
74
- requirement: &70264868600580 !ruby/object:Gem::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: *70264868600580
82
+ version_requirements: *70356947438620
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: paperclip
85
- requirement: &70264868599680 !ruby/object:Gem::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: *70264868599680
93
+ version_requirements: *70356947452740
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: meta_search
96
- requirement: &70264868619680 !ruby/object:Gem::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: *70264868619680
104
+ version_requirements: *70356947451720
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: activemerchant
107
- requirement: &70264868618920 !ruby/object:Gem::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: *70264868618920
115
+ version_requirements: *70356947450920
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: rails
118
- requirement: &70264868618320 !ruby/object:Gem::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: *70264868618320
129
+ version_requirements: *70356947449720
130
130
  - !ruby/object:Gem::Dependency
131
131
  name: kaminari
132
- requirement: &70264868617520 !ruby/object:Gem::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: *70264868617520
140
+ version_requirements: *70356947447900
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: deface
143
- requirement: &70264868617000 !ruby/object:Gem::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: *70264868617000
151
+ version_requirements: *70356947446980
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: stringex
154
- requirement: &70264868616380 !ruby/object:Gem::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: *70264868616380
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: 2163052679988616471
976
+ hash: -2957388299349255017
977
977
  requirements:
978
978
  - none
979
979
  rubyforge_project: spree_core