saasaparilla 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ class Subscription < ActiveRecord::Base
32
32
 
33
33
  scope :all_invoiceable, lambda {|date|
34
34
  #find all subscriptions not been invoiced within the last month
35
- where("billing_date <= ? and (invoiced_on > ? OR invoiced_on is null)", date + 5.days, (date - 1.months).to_time)
35
+ where("billing_date <= ? and (invoiced_on > ? OR invoiced_on is null) and id not in (select id from subscriptions where invoiced_on > ?) ", date + 5.days, (date - 1.months).to_time, date - 5.days)
36
36
  }
37
37
 
38
38
  scope :all_paid, where("no_charge != ?", true)
@@ -1,3 +1,3 @@
1
1
  module Saasaparilla
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -30,7 +30,7 @@ Factory.define :credit_card, :class => CreditCard do |f|
30
30
  f.card_number "4111111111111111"
31
31
  f.card_verification "545"
32
32
  f.expiry_month "10"
33
- f.expiry_year "2011"
33
+ f.expiry_year "2015"
34
34
 
35
35
  end
36
36
 
@@ -240,12 +240,12 @@ describe Subscription do
240
240
  it 'should find invoiceable models' do
241
241
  @subscription1.update_attributes(:billing_date => (Date.today + 1.days))
242
242
  @subscription2.update_attributes(:billing_date => (Date.today + 6.days))
243
- @subscription3.update_attributes(:billing_date => (Date.today + 5.days), :invoiced_on => Date.today - 1.months)
243
+ @subscription3.update_attributes(:billing_date => (Date.today + 5.days), :invoiced_on => Date.today - 1.months - 2.days)
244
244
  @subscription4.update_attributes(:billing_date => (Date.today + 5.days), :invoiced_on => Date.today - 2.days)
245
245
  @subscriptions = Subscription.active.all_invoiceable(Date.today)
246
- @subscriptions.count.should == 2
246
+ @subscriptions.count.should == 1
247
247
  @subscriptions.should include @subscription1
248
- @subscriptions.should include @subscription4
248
+
249
249
  end
250
250
 
251
251
  it 'should find billable models' do
metadata CHANGED
@@ -1,346 +1,267 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: saasaparilla
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.8
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 7
10
- version: 0.1.7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jon Ohrt
14
9
  - Matt Fordham
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-11-30 00:00:00 -08:00
13
+ date: 2012-02-21 00:00:00.000000000 -08:00
20
14
  default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: bartt-ssl_requirement
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: &2167202840 !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
34
24
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: will_paginate
38
25
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: *2167202840
27
+ - !ruby/object:Gem::Dependency
28
+ name: will_paginate
29
+ requirement: &2167202260 !ruby/object:Gem::Requirement
40
30
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
48
35
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: haml
52
36
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
37
+ version_requirements: *2167202260
38
+ - !ruby/object:Gem::Dependency
39
+ name: haml
40
+ requirement: &2167201760 !ruby/object:Gem::Requirement
54
41
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
62
46
  type: :runtime
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: jquery-rails
66
47
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
48
+ version_requirements: *2167201760
49
+ - !ruby/object:Gem::Dependency
50
+ name: jquery-rails
51
+ requirement: &2167201280 !ruby/object:Gem::Requirement
68
52
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
76
57
  type: :runtime
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: dynamic_attributes
80
58
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
59
+ version_requirements: *2167201280
60
+ - !ruby/object:Gem::Dependency
61
+ name: dynamic_attributes
62
+ requirement: &2167200740 !ruby/object:Gem::Requirement
82
63
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
90
68
  type: :runtime
91
- version_requirements: *id005
92
- - !ruby/object:Gem::Dependency
93
- name: authlogic
94
69
  prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
70
+ version_requirements: *2167200740
71
+ - !ruby/object:Gem::Dependency
72
+ name: authlogic
73
+ requirement: &2167200260 !ruby/object:Gem::Requirement
96
74
  none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
104
79
  type: :runtime
105
- version_requirements: *id006
106
- - !ruby/object:Gem::Dependency
107
- name: activemerchant
108
80
  prerelease: false
109
- requirement: &id007 !ruby/object:Gem::Requirement
81
+ version_requirements: *2167200260
82
+ - !ruby/object:Gem::Dependency
83
+ name: activemerchant
84
+ requirement: &2167199760 !ruby/object:Gem::Requirement
110
85
  none: false
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- hash: 3
115
- segments:
116
- - 0
117
- version: "0"
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
118
90
  type: :runtime
119
- version_requirements: *id007
120
- - !ruby/object:Gem::Dependency
121
- name: simple_form
122
91
  prerelease: false
123
- requirement: &id008 !ruby/object:Gem::Requirement
92
+ version_requirements: *2167199760
93
+ - !ruby/object:Gem::Dependency
94
+ name: simple_form
95
+ requirement: &2167179260 !ruby/object:Gem::Requirement
124
96
  none: false
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- hash: 3
129
- segments:
130
- - 0
131
- version: "0"
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
132
101
  type: :runtime
133
- version_requirements: *id008
134
- - !ruby/object:Gem::Dependency
135
- name: dynamic_form
136
102
  prerelease: false
137
- requirement: &id009 !ruby/object:Gem::Requirement
103
+ version_requirements: *2167179260
104
+ - !ruby/object:Gem::Dependency
105
+ name: dynamic_form
106
+ requirement: &2167178740 !ruby/object:Gem::Requirement
138
107
  none: false
139
- requirements:
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- hash: 3
143
- segments:
144
- - 0
145
- version: "0"
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
146
112
  type: :runtime
147
- version_requirements: *id009
148
- - !ruby/object:Gem::Dependency
149
- name: i18n
150
113
  prerelease: false
151
- requirement: &id010 !ruby/object:Gem::Requirement
114
+ version_requirements: *2167178740
115
+ - !ruby/object:Gem::Dependency
116
+ name: i18n
117
+ requirement: &2167178220 !ruby/object:Gem::Requirement
152
118
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 3
157
- segments:
158
- - 0
159
- version: "0"
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
160
123
  type: :runtime
161
- version_requirements: *id010
162
- - !ruby/object:Gem::Dependency
163
- name: activemerchant
164
124
  prerelease: false
165
- requirement: &id011 !ruby/object:Gem::Requirement
125
+ version_requirements: *2167178220
126
+ - !ruby/object:Gem::Dependency
127
+ name: activemerchant
128
+ requirement: &2167177740 !ruby/object:Gem::Requirement
166
129
  none: false
167
- requirements:
168
- - - ">="
169
- - !ruby/object:Gem::Version
170
- hash: 71
171
- segments:
172
- - 1
173
- - 20
174
- - 0
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
175
133
  version: 1.20.0
176
134
  type: :runtime
177
- version_requirements: *id011
178
- - !ruby/object:Gem::Dependency
179
- name: autotest-growl
180
135
  prerelease: false
181
- requirement: &id012 !ruby/object:Gem::Requirement
136
+ version_requirements: *2167177740
137
+ - !ruby/object:Gem::Dependency
138
+ name: autotest-growl
139
+ requirement: &2167177220 !ruby/object:Gem::Requirement
182
140
  none: false
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- hash: 3
187
- segments:
188
- - 0
189
- version: "0"
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
190
145
  type: :development
191
- version_requirements: *id012
192
- - !ruby/object:Gem::Dependency
193
- name: autotest-fsevent
194
146
  prerelease: false
195
- requirement: &id013 !ruby/object:Gem::Requirement
147
+ version_requirements: *2167177220
148
+ - !ruby/object:Gem::Dependency
149
+ name: autotest-fsevent
150
+ requirement: &2167176620 !ruby/object:Gem::Requirement
196
151
  none: false
197
- requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- hash: 3
201
- segments:
202
- - 0
203
- version: "0"
152
+ requirements:
153
+ - - ! '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
204
156
  type: :development
205
- version_requirements: *id013
206
- - !ruby/object:Gem::Dependency
207
- name: autotest-rails
208
157
  prerelease: false
209
- requirement: &id014 !ruby/object:Gem::Requirement
158
+ version_requirements: *2167176620
159
+ - !ruby/object:Gem::Dependency
160
+ name: autotest-rails
161
+ requirement: &2167175840 !ruby/object:Gem::Requirement
210
162
  none: false
211
- requirements:
212
- - - ">="
213
- - !ruby/object:Gem::Version
214
- hash: 3
215
- segments:
216
- - 0
217
- version: "0"
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
218
167
  type: :development
219
- version_requirements: *id014
220
- - !ruby/object:Gem::Dependency
221
- name: factory_girl_rails
222
168
  prerelease: false
223
- requirement: &id015 !ruby/object:Gem::Requirement
169
+ version_requirements: *2167175840
170
+ - !ruby/object:Gem::Dependency
171
+ name: factory_girl_rails
172
+ requirement: &2167175280 !ruby/object:Gem::Requirement
224
173
  none: false
225
- requirements:
226
- - - ">="
227
- - !ruby/object:Gem::Version
228
- hash: 21
229
- segments:
230
- - 1
231
- - 0
232
- - 1
174
+ requirements:
175
+ - - ! '>='
176
+ - !ruby/object:Gem::Version
233
177
  version: 1.0.1
234
178
  type: :development
235
- version_requirements: *id015
236
- - !ruby/object:Gem::Dependency
237
- name: rspec-rails
238
179
  prerelease: false
239
- requirement: &id016 !ruby/object:Gem::Requirement
180
+ version_requirements: *2167175280
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec-rails
183
+ requirement: &2167174800 !ruby/object:Gem::Requirement
240
184
  none: false
241
- requirements:
242
- - - ">="
243
- - !ruby/object:Gem::Version
244
- hash: 3
245
- segments:
246
- - 0
247
- version: "0"
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
248
189
  type: :development
249
- version_requirements: *id016
250
- - !ruby/object:Gem::Dependency
251
- name: database_cleaner
252
190
  prerelease: false
253
- requirement: &id017 !ruby/object:Gem::Requirement
191
+ version_requirements: *2167174800
192
+ - !ruby/object:Gem::Dependency
193
+ name: database_cleaner
194
+ requirement: &2167174280 !ruby/object:Gem::Requirement
254
195
  none: false
255
- requirements:
256
- - - ">="
257
- - !ruby/object:Gem::Version
258
- hash: 3
259
- segments:
260
- - 0
261
- version: "0"
196
+ requirements:
197
+ - - ! '>='
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
262
200
  type: :development
263
- version_requirements: *id017
264
- - !ruby/object:Gem::Dependency
265
- name: spork
266
201
  prerelease: false
267
- requirement: &id018 !ruby/object:Gem::Requirement
202
+ version_requirements: *2167174280
203
+ - !ruby/object:Gem::Dependency
204
+ name: spork
205
+ requirement: &2167173760 !ruby/object:Gem::Requirement
268
206
  none: false
269
- requirements:
270
- - - ">="
271
- - !ruby/object:Gem::Version
272
- hash: 3
273
- segments:
274
- - 0
275
- version: "0"
207
+ requirements:
208
+ - - ! '>='
209
+ - !ruby/object:Gem::Version
210
+ version: '0'
276
211
  type: :development
277
- version_requirements: *id018
278
- - !ruby/object:Gem::Dependency
279
- name: launchy
280
212
  prerelease: false
281
- requirement: &id019 !ruby/object:Gem::Requirement
213
+ version_requirements: *2167173760
214
+ - !ruby/object:Gem::Dependency
215
+ name: launchy
216
+ requirement: &2167173280 !ruby/object:Gem::Requirement
282
217
  none: false
283
- requirements:
284
- - - ">="
285
- - !ruby/object:Gem::Version
286
- hash: 3
287
- segments:
288
- - 0
289
- version: "0"
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
290
222
  type: :development
291
- version_requirements: *id019
292
- - !ruby/object:Gem::Dependency
293
- name: shoulda
294
223
  prerelease: false
295
- requirement: &id020 !ruby/object:Gem::Requirement
224
+ version_requirements: *2167173280
225
+ - !ruby/object:Gem::Dependency
226
+ name: shoulda
227
+ requirement: &2167172780 !ruby/object:Gem::Requirement
296
228
  none: false
297
- requirements:
298
- - - ">="
299
- - !ruby/object:Gem::Version
300
- hash: 3
301
- segments:
302
- - 0
303
- version: "0"
229
+ requirements:
230
+ - - ! '>='
231
+ - !ruby/object:Gem::Version
232
+ version: '0'
304
233
  type: :development
305
- version_requirements: *id020
306
- - !ruby/object:Gem::Dependency
307
- name: ZenTest
308
234
  prerelease: false
309
- requirement: &id021 !ruby/object:Gem::Requirement
235
+ version_requirements: *2167172780
236
+ - !ruby/object:Gem::Dependency
237
+ name: ZenTest
238
+ requirement: &2167172280 !ruby/object:Gem::Requirement
310
239
  none: false
311
- requirements:
312
- - - ">="
313
- - !ruby/object:Gem::Version
314
- hash: 3
315
- segments:
316
- - 0
317
- version: "0"
240
+ requirements:
241
+ - - ! '>='
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
318
244
  type: :development
319
- version_requirements: *id021
320
- - !ruby/object:Gem::Dependency
321
- name: email_spec
322
245
  prerelease: false
323
- requirement: &id022 !ruby/object:Gem::Requirement
246
+ version_requirements: *2167172280
247
+ - !ruby/object:Gem::Dependency
248
+ name: email_spec
249
+ requirement: &2167171780 !ruby/object:Gem::Requirement
324
250
  none: false
325
- requirements:
326
- - - ">="
327
- - !ruby/object:Gem::Version
328
- hash: 3
329
- segments:
330
- - 0
331
- version: "0"
251
+ requirements:
252
+ - - ! '>='
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
332
255
  type: :development
333
- version_requirements: *id022
256
+ prerelease: false
257
+ version_requirements: *2167171780
334
258
  description: Simple SAAS through Authorize.net
335
- email:
259
+ email:
336
260
  - jonohrt1@gmail.com
337
261
  executables: []
338
-
339
262
  extensions: []
340
-
341
263
  extra_rdoc_files: []
342
-
343
- files:
264
+ files:
344
265
  - .gitignore
345
266
  - .rspec
346
267
  - Gemfile
@@ -504,40 +425,31 @@ files:
504
425
  - spec/spec_helper.rb
505
426
  - spec/spec_helpers/spec_helpers.rb
506
427
  has_rdoc: true
507
- homepage: ""
428
+ homepage: ''
508
429
  licenses: []
509
-
510
430
  post_install_message:
511
431
  rdoc_options: []
512
-
513
- require_paths:
432
+ require_paths:
514
433
  - lib
515
- required_ruby_version: !ruby/object:Gem::Requirement
434
+ required_ruby_version: !ruby/object:Gem::Requirement
516
435
  none: false
517
- requirements:
518
- - - ">="
519
- - !ruby/object:Gem::Version
520
- hash: 3
521
- segments:
522
- - 0
523
- version: "0"
524
- required_rubygems_version: !ruby/object:Gem::Requirement
436
+ requirements:
437
+ - - ! '>='
438
+ - !ruby/object:Gem::Version
439
+ version: '0'
440
+ required_rubygems_version: !ruby/object:Gem::Requirement
525
441
  none: false
526
- requirements:
527
- - - ">="
528
- - !ruby/object:Gem::Version
529
- hash: 3
530
- segments:
531
- - 0
532
- version: "0"
442
+ requirements:
443
+ - - ! '>='
444
+ - !ruby/object:Gem::Version
445
+ version: '0'
533
446
  requirements: []
534
-
535
447
  rubyforge_project: saasaparilla
536
- rubygems_version: 1.4.2
448
+ rubygems_version: 1.6.2
537
449
  signing_key:
538
450
  specification_version: 3
539
451
  summary: Simple SAAS through Authorize.net
540
- test_files:
452
+ test_files:
541
453
  - spec/dummy/Rakefile
542
454
  - spec/dummy/app/controllers/application_controller.rb
543
455
  - spec/dummy/app/helpers/application_helper.rb