piggybak 0.6.26 → 0.6.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- piggybak (0.6.26)
4
+ piggybak (0.6.27)
5
5
  activemerchant
6
6
  countries
7
7
  devise
8
8
  rack-ssl-enforcer
9
9
  rails (~> 3.2.8)
10
- rails_admin (~> 0.3.0)
10
+ rails_admin (~> 0.4.5)
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- actionmailer (3.2.8)
16
- actionpack (= 3.2.8)
17
- mail (~> 2.4.4)
18
- actionpack (3.2.8)
19
- activemodel (= 3.2.8)
20
- activesupport (= 3.2.8)
15
+ actionmailer (3.2.13)
16
+ actionpack (= 3.2.13)
17
+ mail (~> 2.5.3)
18
+ actionpack (3.2.13)
19
+ activemodel (= 3.2.13)
20
+ activesupport (= 3.2.13)
21
21
  builder (~> 3.0.0)
22
22
  erubis (~> 2.7.0)
23
23
  journey (~> 1.0.4)
24
- rack (~> 1.4.0)
24
+ rack (~> 1.4.5)
25
25
  rack-cache (~> 1.2)
26
26
  rack-test (~> 0.6.1)
27
- sprockets (~> 2.1.3)
27
+ sprockets (~> 2.2.1)
28
28
  active_utils (1.0.5)
29
29
  activesupport (>= 2.3.11)
30
30
  i18n
31
- activemerchant (1.29.0)
31
+ activemerchant (1.31.1)
32
32
  active_utils (>= 1.0.2)
33
33
  activesupport (>= 2.3.14)
34
34
  builder (>= 2.0.0)
@@ -36,23 +36,23 @@ GEM
36
36
  json (>= 1.5.1)
37
37
  money
38
38
  nokogiri
39
- activemodel (3.2.8)
40
- activesupport (= 3.2.8)
39
+ activemodel (3.2.13)
40
+ activesupport (= 3.2.13)
41
41
  builder (~> 3.0.0)
42
- activerecord (3.2.8)
43
- activemodel (= 3.2.8)
44
- activesupport (= 3.2.8)
42
+ activerecord (3.2.13)
43
+ activemodel (= 3.2.13)
44
+ activesupport (= 3.2.13)
45
45
  arel (~> 3.0.2)
46
46
  tzinfo (~> 0.3.29)
47
- activeresource (3.2.8)
48
- activemodel (= 3.2.8)
49
- activesupport (= 3.2.8)
50
- activesupport (3.2.8)
51
- i18n (~> 0.6)
47
+ activeresource (3.2.13)
48
+ activemodel (= 3.2.13)
49
+ activesupport (= 3.2.13)
50
+ activesupport (3.2.13)
51
+ i18n (= 0.6.1)
52
52
  multi_json (~> 1.0)
53
53
  arel (3.0.2)
54
54
  bcrypt-ruby (3.0.1)
55
- bootstrap-sass (2.2.1.1)
55
+ bootstrap-sass (2.3.1.0)
56
56
  sass (~> 3.2)
57
57
  builder (3.0.4)
58
58
  coffee-rails (3.2.2)
@@ -61,12 +61,11 @@ GEM
61
61
  coffee-script (2.2.0)
62
62
  coffee-script-source
63
63
  execjs
64
- coffee-script-source (1.4.0)
65
- countries (0.8.1)
66
- currencies (= 0.4.0)
67
- currencies (>= 0.2.0)
64
+ coffee-script-source (1.6.2)
65
+ countries (0.9.2)
66
+ currencies (>= 0.4.0)
68
67
  currencies (0.4.0)
69
- devise (2.1.2)
68
+ devise (2.2.3)
70
69
  bcrypt-ruby (~> 3.0)
71
70
  orm_adapter (~> 0.1)
72
71
  railties (~> 3.1)
@@ -74,94 +73,98 @@ GEM
74
73
  erubis (2.7.0)
75
74
  execjs (1.4.0)
76
75
  multi_json (~> 1.0)
77
- font-awesome-sass-rails (2.0.0.0)
76
+ font-awesome-sass-rails (3.0.2.2)
78
77
  railties (>= 3.1.1)
79
78
  sass-rails (>= 3.1.1)
80
- haml (3.1.7)
79
+ haml (4.0.1)
80
+ tilt
81
81
  hike (1.2.1)
82
82
  i18n (0.6.1)
83
83
  journey (1.0.4)
84
- jquery-rails (2.1.3)
85
- railties (>= 3.1.0, < 5.0)
86
- thor (~> 0.14)
87
- jquery-ui-rails (2.0.2)
84
+ jquery-rails (2.2.1)
85
+ railties (>= 3.0, < 5.0)
86
+ thor (>= 0.14, < 2.0)
87
+ jquery-ui-rails (3.0.1)
88
88
  jquery-rails
89
89
  railties (>= 3.1.0)
90
- json (1.7.5)
90
+ json (1.7.7)
91
91
  kaminari (0.14.1)
92
92
  actionpack (>= 3.0.0)
93
93
  activesupport (>= 3.0.0)
94
- mail (2.4.4)
94
+ mail (2.5.3)
95
95
  i18n (>= 0.4.0)
96
96
  mime-types (~> 1.16)
97
97
  treetop (~> 1.4.8)
98
- mime-types (1.19)
99
- money (5.1.0)
98
+ mime-types (1.21)
99
+ money (5.1.1)
100
100
  i18n (~> 0.6.0)
101
- multi_json (1.3.6)
101
+ multi_json (1.7.2)
102
102
  nested_form (0.3.1)
103
- nokogiri (1.5.5)
103
+ nokogiri (1.5.9)
104
104
  orm_adapter (0.4.0)
105
105
  polyglot (0.3.3)
106
- rack (1.4.1)
106
+ rack (1.4.5)
107
107
  rack-cache (1.2)
108
108
  rack (>= 0.4)
109
- rack-pjax (0.6.0)
109
+ rack-pjax (0.7.0)
110
110
  nokogiri (~> 1.5)
111
111
  rack (~> 1.3)
112
- rack-ssl (1.3.2)
112
+ rack-ssl (1.3.3)
113
113
  rack
114
- rack-ssl-enforcer (0.2.4)
114
+ rack-ssl-enforcer (0.2.5)
115
115
  rack-test (0.6.2)
116
116
  rack (>= 1.0)
117
- rails (3.2.8)
118
- actionmailer (= 3.2.8)
119
- actionpack (= 3.2.8)
120
- activerecord (= 3.2.8)
121
- activeresource (= 3.2.8)
122
- activesupport (= 3.2.8)
117
+ rails (3.2.13)
118
+ actionmailer (= 3.2.13)
119
+ actionpack (= 3.2.13)
120
+ activerecord (= 3.2.13)
121
+ activeresource (= 3.2.13)
122
+ activesupport (= 3.2.13)
123
123
  bundler (~> 1.0)
124
- railties (= 3.2.8)
125
- rails_admin (0.3.0)
126
- bootstrap-sass (~> 2.1)
124
+ railties (= 3.2.13)
125
+ rails_admin (0.4.6)
126
+ bootstrap-sass (~> 2.2)
127
127
  builder (~> 3.0)
128
128
  coffee-rails (~> 3.1)
129
- font-awesome-sass-rails (~> 2.0)
130
- haml (~> 3.1)
129
+ font-awesome-sass-rails (~> 3.0, >= 3.0.0.1)
130
+ haml (~> 4.0)
131
131
  jquery-rails (~> 2.1)
132
- jquery-ui-rails (~> 2.0)
132
+ jquery-ui-rails (~> 3.0)
133
133
  kaminari (~> 0.14)
134
- nested_form (> 0.2.3, < 0.4.0)
134
+ nested_form (~> 0.3)
135
135
  rack-pjax (~> 0.6)
136
136
  rails (~> 3.1)
137
137
  remotipart (~> 1.0)
138
+ safe_yaml (~> 0.6)
138
139
  sass-rails (~> 3.1)
139
- railties (3.2.8)
140
- actionpack (= 3.2.8)
141
- activesupport (= 3.2.8)
140
+ railties (3.2.13)
141
+ actionpack (= 3.2.13)
142
+ activesupport (= 3.2.13)
142
143
  rack-ssl (~> 1.3.2)
143
144
  rake (>= 0.8.7)
144
145
  rdoc (~> 3.4)
145
146
  thor (>= 0.14.6, < 2.0)
146
- rake (0.9.2.2)
147
- rdoc (3.12)
147
+ rake (10.0.3)
148
+ rdoc (3.12.2)
148
149
  json (~> 1.4)
149
- remotipart (1.0.2)
150
- sass (3.2.3)
151
- sass-rails (3.2.5)
150
+ remotipart (1.0.5)
151
+ safe_yaml (0.8.6)
152
+ sass (3.2.7)
153
+ sass-rails (3.2.6)
152
154
  railties (~> 3.2.0)
153
155
  sass (>= 3.1.10)
154
156
  tilt (~> 1.3)
155
- sprockets (2.1.3)
157
+ sprockets (2.2.2)
156
158
  hike (~> 1.2)
159
+ multi_json (~> 1.0)
157
160
  rack (~> 1.0)
158
161
  tilt (~> 1.1, != 1.3.0)
159
- thor (0.16.0)
160
- tilt (1.3.3)
162
+ thor (0.17.0)
163
+ tilt (1.3.6)
161
164
  treetop (1.4.12)
162
165
  polyglot
163
166
  polyglot (>= 0.3.1)
164
- tzinfo (0.3.35)
167
+ tzinfo (0.3.37)
165
168
  warden (1.2.1)
166
169
  rack (>= 1.0)
167
170
 
@@ -20,10 +20,10 @@ $(function() {
20
20
  var piggybak = {
21
21
  shipping_els: $('#piggybak_order_shipping_address_attributes_state_id,#piggybak_order_shipping_address_attributes_country_id,#piggybak_order_shipping_address_attributes_zip'),
22
22
  initialize_listeners: function() {
23
- piggybak.shipping_els.live('change', function() {
23
+ piggybak.shipping_els.on('change', function() {
24
24
  piggybak.update_shipping_options($(this));
25
25
  });
26
- $('#piggybak_order_billing_address_attributes_state_id').live('change', function() {
26
+ $('#piggybak_order_billing_address_attributes_state_id').on('change', function() {
27
27
  piggybak.update_tax();
28
28
  });
29
29
  $('#shipping select').change(function() {
@@ -25,14 +25,14 @@ module Piggybak
25
25
  self.price ||= 0
26
26
 
27
27
  # TODO: Fix this, should default in database
28
- self.created_at ||= Time.now
28
+ self.created_at ||= Time.now
29
29
  end
30
30
 
31
31
  def preprocess
32
32
  # TODO: Investigate if this is unnecessary if you use reject_if on accepts_nested_attributes_for
33
33
  Piggybak.config.line_item_types.each do |k, v|
34
34
  if v.has_key?(:nested_attrs) && k != self.line_item_type.to_sym
35
- self.send("#{k}=", nil)
35
+ self.send("#{k}=", nil)
36
36
  end
37
37
  end
38
38
 
@@ -55,16 +55,16 @@ module Piggybak
55
55
  if self.new_record?
56
56
  quantity_change = self.quantity.to_i
57
57
  elsif self.changes.keys.include?("quantity") && self.quantity > self.quantity_was
58
- quantity_change = self.quantity - self.quantity_was
58
+ quantity_change = self.quantity - self.quantity_was
59
59
  end
60
60
  if sellable.quantity < quantity_change && !sellable.unlimited_inventory
61
61
  self.errors.add(:sellable_id, "Insufficient inventory by #{quantity_change - sellable.quantity} unit(s).")
62
62
  return
63
- end
63
+ end
64
64
 
65
65
  self.description = sellable.description
66
66
  self.unit_price = sellable.price
67
- self.price = self.unit_price*self.quantity.to_i
67
+ self.price = self.unit_price*self.quantity.to_i
68
68
  end
69
69
 
70
70
  def preprocess_shipment
@@ -84,7 +84,8 @@ module Piggybak
84
84
 
85
85
  def preprocess_payment
86
86
  if self.new_record?
87
- self.payment.payment_method_id ||= Piggybak::PaymentMethod.find_by_active(true).id if self.payment
87
+ self.build_payment if self.payment.nil?
88
+ self.payment.payment_method_id ||= Piggybak::PaymentMethod.find_by_active(true).id
88
89
  self.description = "Payment"
89
90
  self.price = 0
90
91
  end
@@ -1,3 +1,3 @@
1
1
  module Piggybak
2
- VERSION = "0.6.26"
2
+ VERSION = "0.6.27"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggybak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.26
4
+ version: 0.6.27
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-02-18 00:00:00.000000000 Z
14
+ date: 2013-03-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ~>
38
38
  - !ruby/object:Gem::Version
39
- version: 0.3.0
39
+ version: 0.4.5
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.0
47
+ version: 0.4.5
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: countries
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
235
  version: '0'
236
236
  segments:
237
237
  - 0
238
- hash: 1382762029700944046
238
+ hash: 2870291958582205091
239
239
  required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  none: false
241
241
  requirements:
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  version: '0'
245
245
  segments:
246
246
  - 0
247
- hash: 1382762029700944046
247
+ hash: 2870291958582205091
248
248
  requirements: []
249
249
  rubyforge_project:
250
250
  rubygems_version: 1.8.23