payola-payments 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjIxZGY2MjlkN2Q2ZDQzNjY5MzJmYjk5ZGNlYTJmMjQxMzk3YjdkNg==
4
+ YmIwODY5ZGNhN2Y3ZjUxNjBkYzFkNjQxYmNiNmZkZmI4Njg5M2ZmZQ==
5
5
  data.tar.gz: !binary |-
6
- YWE1MjhiMjBjYjU5ODI3ZjFmZjUyNzQ2NGJhOTI3NDQ1MGFkODg5Mg==
6
+ MmY5YjUxZTY5MTQ1Y2U0NTEzYTk2YjM0YjQzYTNlNDdjMTAyNWU0Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzUyYzEzMTZhZDBiMWM0MmVhNDQxNWZiZGFlZmI1ZGZiYzE0NzM4ZDIyZGQ3
10
- ZDRlZjI2OWNjNGMxY2QzMjhjZWMxNmQ1NjhhNjU0NmE5NTc4NmQyZWEyNDk4
11
- MjNhZGQ2YmY0MGQ0ZGM4MTRiYmE5ZDE1ZDQzZDJiMzk0NDViOWI=
9
+ MzVmNDVhZDExZTdhOTkxMzY3ZDdlMGNkMGQwMGM2YWE1ODAxNmIxZGU2ZDVl
10
+ Y2RiMjE5OWYxNDJmNGI3MWQxNDE0MDlkOTczMjg5NTE4Y2E1YjJiYzEyYTNk
11
+ NmZhYTUzZjRjNmU0OGVkYmQ4ZjZjMjMzNzA1OGIxOTExYTMxYmM=
12
12
  data.tar.gz: !binary |-
13
- OGEwNzI3NjdmMmRiNTg0OTgxNTczODllMGQ5MTQzZTk1ODc3MzUxYzQ2YWJj
14
- NjdhYjBiYjkwMjA5YTk3NDU5MjUyNWEzZjQ4ODU0MTkyMzk3ZDQ2Y2QzYzFj
15
- YTBlMTZlZDVmZmU0OWU5ZDA2YzBiYjMyOGJkYjMwMzQyOTE2YjM=
13
+ OTI1M2YwMTAyMTEzN2RhYWRkZGU5Y2Q1ZTgyMTM5YjMwZTAxNzY0OWIxNmM0
14
+ ZTcxMmViZDVlZjU1YjIxMTgyYjAxNDcwNzUwMjg3YzE1NTUzYzM1YTU3N2U5
15
+ ZjVlMTY1ZTg3Y2MyYTk4NWEzMzBiZDNmMzEwNDBkYTE3YzM4NDA=
@@ -3,8 +3,8 @@ module Payola
3
3
  before_filter :find_product_and_coupon_and_affiliate, only: [:create]
4
4
 
5
5
  def show
6
- @sale = Sale.find_by!(guid: params[:guid])
7
- @product = @sale.product
6
+ sale = Sale.find_by!(guid: params[:guid])
7
+ product = sale.product
8
8
 
9
9
  redirect_to product.redirect_path(sale)
10
10
  end
@@ -1,17 +1,18 @@
1
1
  <%
2
- button_class ||= "stripe-button-el"
3
- button_text ||= "Pay Now"
4
- description ||= "#{sale.product.name} (#{formatted_price(sale.product.price)})"
5
- name ||= sale.product.name
6
- product_image_path ||= ""
7
- panel_label ||= ""
8
- allow_remember_me = defined?(allow_remember_me) ? allow_remember_me : true
9
- email ||= ""
10
- verify_zip_code = defined?(verify_zip_code) ? verify_zip_code : false
2
+ button_class = local_assigns.fetch :button_class, "stripe-button-el"
3
+ button_inner_style = local_assigns.fetch :button_inner_style, 'min-height: 30px'
4
+ button_text = local_assigns.fetch :button_text, "Pay Now"
5
+ description = local_assigns.fetch :description, "#{sale.product.name} (#{formatted_price(sale.product.price)})"
6
+ name = local_assigns.fetch :name, sale.product.name
7
+ product_image_path = local_assigns.fetch :product_image_path , ''
8
+ panel_label = local_assigns.fetch :panel_label, ''
9
+ allow_remember_me = local_assigns.fetch :allow_remember_me, true
10
+ email = local_assigns.fetch :email, ''
11
+ verify_zip_code = local_assigns.fetch :verify_zip_code, false
11
12
 
12
- button_id ||= "payola-button-#{sale.product.product_class}-#{sale.product.permalink}"
13
- error_div_id ||= "#{button_id}-errors"
14
- form_id ||= "#{button_id}-form"
13
+ button_id = "payola-button-#{sale.product.product_class}-#{sale.product.permalink}"
14
+ error_div_id = "#{button_id}-errors"
15
+ form_id = "#{button_id}-form"
15
16
  button_text_id = "#{button_id}-span"
16
17
  button_spinner_id = "#{button_id}-spinner"
17
18
  %>
@@ -20,9 +21,9 @@
20
21
  <link rel="stylesheet" href="https://checkout.stripe.com/v3/checkout/button.css"></link>
21
22
 
22
23
  <%= form_tag payola.buy_path(product_class: sale.product.product_class, permalink: sale.product.permalink), id: form_id do %>
23
- <button class="stripe-button-el" id="<%= button_id %>">
24
- <span id="<%= button_text_id %>" style="display: block; min-height: 30px;"><%= button_text %></span>
25
- <span id="<%= button_spinner_id %>" style="display:none;min-iehgt: 30px;">Please wait...</span>
24
+ <button class="<%= button_class %>" id="<%= button_id %>">
25
+ <span id="<%= button_text_id %>" style="display: block; <%= button_inner_style %>"><%= button_text %></span>
26
+ <span id="<%= button_spinner_id %>" style="display: none; <%= button_inner_style %>">Please wait...</span>
26
27
  </button>
27
28
  <div style="display:none", id="<%= error_div_id %>"></div>
28
29
  <% end %>
@@ -0,0 +1 @@
1
+ require_relative './payola'
data/lib/payola/engine.rb CHANGED
@@ -9,5 +9,13 @@ module Payola
9
9
  g.assets false
10
10
  g.helper false
11
11
  end
12
+
13
+ initializer :append_migrations do |app|
14
+ unless app.root.to_s.match root.to_s
15
+ config.paths["db/migrate"].expanded.each do |expanded_path|
16
+ app.config.paths["db/migrate"] << expanded_path
17
+ end
18
+ end
19
+ end
12
20
  end
13
21
  end
@@ -1,3 +1,3 @@
1
1
  module Payola
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/payola/worker.rb CHANGED
@@ -1,3 +1,13 @@
1
+ begin
2
+ require 'sidekiq'
3
+ rescue LoadError
4
+ end
5
+
6
+ begin
7
+ require 'sucker_punch'
8
+ rescue LoadError
9
+ end
10
+
1
11
  module Payola
2
12
  module Worker
3
13
  class << self
@@ -29,24 +39,26 @@ module Payola
29
39
  end
30
40
 
31
41
  class Sidekiq < BaseWorker
42
+ include ::Sidekiq::Worker if defined? ::Sidekiq::Worker
43
+
32
44
  def self.can_run?
33
45
  defined?(::Sidekiq::Worker)
34
46
  end
35
47
 
36
48
  def self.call(sale)
37
- self.send(:include, ::Sidekiq::Worker)
38
- self.perform_async(sale.guid)
49
+ perform_async(sale.guid)
39
50
  end
40
51
  end
41
52
 
42
53
  class SuckerPunch < BaseWorker
54
+ include ::SuckerPunch::Job if defined? ::SuckerPunch::Job
55
+
43
56
  def self.can_run?
44
57
  defined?(::SuckerPunch::Job)
45
58
  end
46
59
 
47
60
  def self.call(sale)
48
- self.send(:include, ::SuckerPunch::Job)
49
- self.new.async.perform(sale.guid)
61
+ new.async.perform(sale.guid)
50
62
  end
51
63
  end
52
64
 
@@ -1 +1 @@
1
- <%= render 'payola/transactions/checkout', sale: @sale, allow_remember_me: false, verify_zip_code: true %>
1
+ <%= render 'payola/transactions/checkout', sale: @sale, button_class: 'not-a-class' %>
@@ -7450,3 +7450,210 @@ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 12:26:53
7450
7450
  Terminating 6 actors...
7451
7451
  Terminating task: type=:finalizer, meta={:method_name=>:__shutdown__}, status=:callwait
7452
7452
  Terminating task: type=:finalizer, meta={:method_name=>:__shutdown__}, status=:callwait
7453
+
7454
+
7455
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:09:47 -0400
7456
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
7457
+ Processing by BuyController#index as HTML
7458
+ Product Load (0.5ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7459
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (27.5ms)
7460
+ Rendered buy/index.html.erb within layouts/application (33.8ms)
7461
+ Completed 200 OK in 173ms (Views: 131.6ms | ActiveRecord: 1.4ms)
7462
+
7463
+
7464
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:09:47 -0400
7465
+
7466
+
7467
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:09:47 -0400
7468
+
7469
+
7470
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:09:47 -0400
7471
+
7472
+
7473
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:13:01 -0400
7474
+ Processing by BuyController#index as HTML
7475
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7476
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (51.5ms)
7477
+ Rendered buy/index.html.erb within layouts/application (52.8ms)
7478
+ Completed 500 Internal Server Error in 56ms
7479
+
7480
+ ActionView::Template::Error (undefined local variable or method `button_text' for #<#<Class:0x007fa61e3d3d78>:0x007fa61fd7cef0>):
7481
+ 1: <%
7482
+ 2: button_class_val = button_class || "stripe-button-el"
7483
+ 3: button_text_val = button_text || "Pay Now"
7484
+ 4: description_val = description || "#{sale.product.name} (#{formatted_price(sale.product.price)})"
7485
+ 5: name_val = name || sale.product.name
7486
+ 6: product_image_path_val = product_image_path || ""
7487
+ app/views/buy/index.html.erb:1:in `_app_views_buy_index_html_erb___1228409309624082551_70175723668200'
7488
+
7489
+
7490
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.2ms)
7491
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.3ms)
7492
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (11.5ms)
7493
+
7494
+
7495
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7496
+ Processing by BuyController#index as HTML
7497
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7498
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (2.4ms)
7499
+ Rendered buy/index.html.erb within layouts/application (3.2ms)
7500
+ Completed 200 OK in 28ms (Views: 26.7ms | ActiveRecord: 0.2ms)
7501
+
7502
+
7503
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7504
+
7505
+
7506
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7507
+
7508
+
7509
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7510
+
7511
+
7512
+ Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7513
+
7514
+
7515
+ Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7516
+
7517
+
7518
+ Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7519
+
7520
+
7521
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:17:10 -0400
7522
+
7523
+
7524
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:17:48 -0400
7525
+ Processing by BuyController#index as HTML
7526
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7527
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (1.6ms)
7528
+ Rendered buy/index.html.erb within layouts/application (2.3ms)
7529
+ Completed 500 Internal Server Error in 62ms
7530
+
7531
+ ActionView::Template::Error (not-a-class):
7532
+ 1: <%
7533
+ 2: raise button_class
7534
+ 3: button_class = local_assigns.fetch :button_class, "stripe-button-el"
7535
+ 4: button_text = local_assigns.fetch :button_text, "Pay Now"
7536
+ 5: description = local_assigns.fetch :description, "#{sale.product.name} (#{formatted_price(sale.product.price)})"
7537
+ app/views/buy/index.html.erb:1:in `_app_views_buy_index_html_erb___1228409309624082551_70175723668200'
7538
+
7539
+
7540
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.2ms)
7541
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.5ms)
7542
+ Rendered /Users/peter/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/actionpack-4.1.6/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (51.4ms)
7543
+
7544
+
7545
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7546
+ Processing by BuyController#index as HTML
7547
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7548
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (2.5ms)
7549
+ Rendered buy/index.html.erb within layouts/application (3.8ms)
7550
+ Completed 200 OK in 28ms (Views: 25.9ms | ActiveRecord: 0.2ms)
7551
+
7552
+
7553
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7554
+
7555
+
7556
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7557
+
7558
+
7559
+ Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7560
+
7561
+
7562
+ Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7563
+
7564
+
7565
+ Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7566
+
7567
+
7568
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:18:12 -0400
7569
+
7570
+
7571
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:18:13 -0400
7572
+
7573
+
7574
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:19:18 -0400
7575
+ Processing by BuyController#index as HTML
7576
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7577
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (3.0ms)
7578
+ Rendered buy/index.html.erb within layouts/application (4.2ms)
7579
+ Completed 200 OK in 75ms (Views: 73.4ms | ActiveRecord: 0.2ms)
7580
+
7581
+
7582
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7583
+
7584
+
7585
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7586
+
7587
+
7588
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7589
+
7590
+
7591
+ Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7592
+
7593
+
7594
+ Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7595
+
7596
+
7597
+ Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7598
+
7599
+
7600
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:19:19 -0400
7601
+
7602
+
7603
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7604
+ Processing by BuyController#index as HTML
7605
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7606
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (3.4ms)
7607
+ Rendered buy/index.html.erb within layouts/application (4.7ms)
7608
+ Completed 200 OK in 29ms (Views: 27.9ms | ActiveRecord: 0.2ms)
7609
+
7610
+
7611
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7612
+
7613
+
7614
+ Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7615
+
7616
+
7617
+ Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7618
+
7619
+
7620
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7621
+
7622
+
7623
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:10 -0400
7624
+
7625
+
7626
+ Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:11 -0400
7627
+
7628
+
7629
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:11 -0400
7630
+
7631
+
7632
+ Started GET "/buy" for 127.0.0.1 at 2014-10-05 17:20:54 -0400
7633
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
7634
+ Processing by BuyController#index as HTML
7635
+ Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
7636
+ Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (36.4ms)
7637
+ Rendered buy/index.html.erb within layouts/application (42.2ms)
7638
+ Completed 200 OK in 245ms (Views: 150.6ms | ActiveRecord: 1.1ms)
7639
+
7640
+
7641
+ Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7642
+
7643
+
7644
+ Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7645
+
7646
+
7647
+ Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7648
+
7649
+
7650
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7651
+
7652
+
7653
+ Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7654
+
7655
+
7656
+ Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
7657
+
7658
+
7659
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-10-05 17:20:55 -0400
@@ -9847,3 +9847,1157 @@
9847
9847
   (0.0ms) rollback transaction
9848
9848
   (0.0ms) begin transaction
9849
9849
   (0.0ms) rollback transaction
9850
+  (1.0ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "email" varchar(255), "percent" integer, "created_at" datetime, "updated_at" datetime) 
9851
+  (1.0ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "percent_off" integer, "created_at" datetime, "updated_at" datetime)
9852
+  (1.0ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "guid" varchar(255), "product_id" integer, "product_type" varchar(255), "created_at" datetime, "updated_at" datetime, "state" varchar(255), "stripe_id" varchar(255), "stripe_token" varchar(255), "card_last4" varchar(255), "card_expiration" date, "card_type" varchar(255), "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar(255)) 
9853
+  (0.2ms) select sqlite_version(*)
9854
+  (1.2ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
9855
+  (0.1ms) SELECT sql
9856
+ FROM sqlite_master
9857
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9858
+ UNION ALL
9859
+ SELECT sql
9860
+ FROM sqlite_temp_master
9861
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9862
+
9863
+  (0.9ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
9864
+  (0.1ms) SELECT sql
9865
+ FROM sqlite_master
9866
+ WHERE name='index_payola_sales_on_email' AND type='index'
9867
+ UNION ALL
9868
+ SELECT sql
9869
+ FROM sqlite_temp_master
9870
+ WHERE name='index_payola_sales_on_email' AND type='index'
9871
+
9872
+  (0.1ms)  SELECT sql
9873
+ FROM sqlite_master
9874
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9875
+ UNION ALL
9876
+ SELECT sql
9877
+ FROM sqlite_temp_master
9878
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9879
+ 
9880
+  (0.9ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
9881
+  (0.1ms)  SELECT sql
9882
+ FROM sqlite_master
9883
+ WHERE name='index_payola_sales_on_guid' AND type='index'
9884
+ UNION ALL
9885
+ SELECT sql
9886
+ FROM sqlite_temp_master
9887
+ WHERE name='index_payola_sales_on_guid' AND type='index'
9888
+ 
9889
+  (0.1ms) SELECT sql
9890
+ FROM sqlite_master
9891
+ WHERE name='index_payola_sales_on_email' AND type='index'
9892
+ UNION ALL
9893
+ SELECT sql
9894
+ FROM sqlite_temp_master
9895
+ WHERE name='index_payola_sales_on_email' AND type='index'
9896
+
9897
+  (0.1ms)  SELECT sql
9898
+ FROM sqlite_master
9899
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9900
+ UNION ALL
9901
+ SELECT sql
9902
+ FROM sqlite_temp_master
9903
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9904
+ 
9905
+  (0.9ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
9906
+  (0.1ms)  SELECT sql
9907
+ FROM sqlite_master
9908
+ WHERE name='index_payola_sales_on_product' AND type='index'
9909
+ UNION ALL
9910
+ SELECT sql
9911
+ FROM sqlite_temp_master
9912
+ WHERE name='index_payola_sales_on_product' AND type='index'
9913
+ 
9914
+  (0.1ms) SELECT sql
9915
+ FROM sqlite_master
9916
+ WHERE name='index_payola_sales_on_guid' AND type='index'
9917
+ UNION ALL
9918
+ SELECT sql
9919
+ FROM sqlite_temp_master
9920
+ WHERE name='index_payola_sales_on_guid' AND type='index'
9921
+
9922
+  (0.1ms)  SELECT sql
9923
+ FROM sqlite_master
9924
+ WHERE name='index_payola_sales_on_email' AND type='index'
9925
+ UNION ALL
9926
+ SELECT sql
9927
+ FROM sqlite_temp_master
9928
+ WHERE name='index_payola_sales_on_email' AND type='index'
9929
+ 
9930
+  (0.1ms) SELECT sql
9931
+ FROM sqlite_master
9932
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9933
+ UNION ALL
9934
+ SELECT sql
9935
+ FROM sqlite_temp_master
9936
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
9937
+
9938
+  (0.9ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
9939
+  (1.0ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "created_at" datetime, "updated_at" datetime)
9940
+  (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "price" integer, "created_at" datetime, "updated_at" datetime) 
9941
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
9942
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9943
+  (0.1ms) SELECT version FROM "schema_migrations"
9944
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
9945
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
9946
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
9947
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
9948
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
9949
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
9950
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
9951
+  (0.1ms) begin transaction
9952
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-1' LIMIT 1
9953
+  (0.1ms) rollback transaction
9954
+  (0.1ms) begin transaction
9955
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'f' LIMIT 1
9956
+  (0.1ms) rollback transaction
9957
+  (0.0ms) begin transaction
9958
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-2' LIMIT 1
9959
+  (0.1ms) rollback transaction
9960
+  (0.0ms) begin transaction
9961
+  (0.0ms) rollback transaction
9962
+  (0.0ms) begin transaction
9963
+  (0.1ms) rollback transaction
9964
+  (0.0ms) begin transaction
9965
+  (0.0ms) SAVEPOINT active_record_1
9966
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-4' LIMIT 1
9967
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.367806"], ["name", "Foo"], ["permalink", "foo-4"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.367806"]]
9968
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9969
+  (0.4ms) rollback transaction
9970
+  (0.1ms) begin transaction
9971
+  (0.1ms) SAVEPOINT active_record_1
9972
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-5' LIMIT 1
9973
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.400529"], ["name", "Foo"], ["permalink", "foo-5"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.400529"]]
9974
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9975
+  (0.1ms) SAVEPOINT active_record_1
9976
+ Payola::Affiliate Exists (0.1ms) SELECT 1 AS one FROM "payola_affiliates" WHERE "payola_affiliates"."code" = 'MyString' LIMIT 1
9977
+ SQL (1.0ms) INSERT INTO "payola_affiliates" ("code", "created_at", "email", "percent", "updated_at") VALUES (?, ?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:07.410131"], ["email", "foo@example.com"], ["percent", 100], ["updated_at", "2014-10-05 21:36:07.410131"]]
9978
+  (0.1ms) RELEASE SAVEPOINT active_record_1
9979
+ Payola::Affiliate Load (0.1ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE "payola_affiliates"."id" = ? LIMIT 1 [["id", 1]]
9980
+  (0.6ms) rollback transaction
9981
+  (0.1ms) begin transaction
9982
+  (0.1ms) SAVEPOINT active_record_1
9983
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-6' LIMIT 1
9984
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.457250"], ["name", "Foo"], ["permalink", "foo-6"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.457250"]]
9985
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9986
+  (0.1ms) SAVEPOINT active_record_1
9987
+ Payola::Coupon Exists (0.1ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
9988
+ SQL (0.4ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:07.468930"], ["percent_off", 1], ["updated_at", "2014-10-05 21:36:07.468930"]]
9989
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9990
+  (0.5ms) rollback transaction
9991
+  (0.0ms) begin transaction
9992
+  (0.0ms) SAVEPOINT active_record_1
9993
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-7' LIMIT 1
9994
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.475026"], ["name", "Foo"], ["permalink", "foo-7"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.475026"]]
9995
+  (0.0ms) RELEASE SAVEPOINT active_record_1
9996
+  (0.0ms) SAVEPOINT active_record_1
9997
+ Payola::Coupon Exists (0.0ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
9998
+ SQL (0.2ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:07.476837"], ["percent_off", 1], ["updated_at", "2014-10-05 21:36:07.476837"]]
9999
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10000
+  (0.4ms) rollback transaction
10001
+  (0.0ms) begin transaction
10002
+  (0.0ms) rollback transaction
10003
+  (0.0ms) begin transaction
10004
+  (0.0ms) rollback transaction
10005
+  (0.1ms) begin transaction
10006
+  (0.1ms) rollback transaction
10007
+  (0.0ms) begin transaction
10008
+  (0.1ms) rollback transaction
10009
+  (0.0ms) begin transaction
10010
+  (0.0ms) rollback transaction
10011
+  (0.0ms) begin transaction
10012
+  (0.0ms) SAVEPOINT active_record_1
10013
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-8' LIMIT 1
10014
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.486993"], ["name", "Foo"], ["permalink", "foo-8"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.486993"]]
10015
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10016
+  (0.0ms) SAVEPOINT active_record_1
10017
+ Payola::Sale Exists (0.2ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10018
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10019
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'avrr4' LIMIT 1
10020
+ SQL (0.7ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.491934"], ["email", "test@example.com"], ["guid", "avrr4"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.491934"]]
10021
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10022
+  (0.0ms) SAVEPOINT active_record_1
10023
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'avrr4' AND "payola_sales"."id" != 1) LIMIT 1
10024
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10025
+  (0.0ms) SAVEPOINT active_record_1
10026
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'avrr4' AND "payola_sales"."id" != 1) LIMIT 1
10027
+ SQL (0.2ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:07.497411"]]
10028
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10029
+  (0.0ms) SAVEPOINT active_record_1
10030
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10031
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10032
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10033
+  (0.5ms) rollback transaction
10034
+  (0.1ms) begin transaction
10035
+  (0.0ms) SAVEPOINT active_record_1
10036
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-9' LIMIT 1
10037
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.507813"], ["name", "Foo"], ["permalink", "foo-9"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.507813"]]
10038
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10039
+  (0.0ms) SAVEPOINT active_record_1
10040
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10041
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10042
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'qihv62' LIMIT 1
10043
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.510330"], ["email", "test@example.com"], ["guid", "qihv62"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.510330"]]
10044
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10045
+  (0.0ms) SAVEPOINT active_record_1
10046
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'qihv62' AND "payola_sales"."id" != 1) LIMIT 1
10047
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10048
+  (0.0ms) SAVEPOINT active_record_1
10049
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'qihv62' AND "payola_sales"."id" != 1) LIMIT 1
10050
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:07.514045"]]
10051
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10052
+  (0.0ms) SAVEPOINT active_record_1
10053
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10054
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10055
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10056
+  (0.6ms) rollback transaction
10057
+  (0.1ms) begin transaction
10058
+  (0.0ms) SAVEPOINT active_record_1
10059
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-10' LIMIT 1
10060
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.519632"], ["name", "Foo"], ["permalink", "foo-10"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.519632"]]
10061
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10062
+  (0.0ms) SAVEPOINT active_record_1
10063
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10064
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10065
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'g7kdvn' LIMIT 1
10066
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.522436"], ["email", "test@example.com"], ["guid", "g7kdvn"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.522436"]]
10067
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10068
+  (0.0ms) SAVEPOINT active_record_1
10069
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'g7kdvn' AND "payola_sales"."id" != 1) LIMIT 1
10070
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10071
+  (0.1ms) SAVEPOINT active_record_1
10072
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'g7kdvn' AND "payola_sales"."id" != 1) LIMIT 1
10073
+ SQL (0.2ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:07.526913"]]
10074
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10075
+  (0.0ms) SAVEPOINT active_record_1
10076
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10077
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10078
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10079
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10080
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10081
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10082
+  (0.5ms) rollback transaction
10083
+  (0.0ms) begin transaction
10084
+  (0.0ms) SAVEPOINT active_record_1
10085
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-11' LIMIT 1
10086
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.533984"], ["name", "Foo"], ["permalink", "foo-11"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.533984"]]
10087
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10088
+  (0.0ms) SAVEPOINT active_record_1
10089
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10090
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10091
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'i3c9h5' LIMIT 1
10092
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.536682"], ["email", "test@example.com"], ["guid", "i3c9h5"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.536682"]]
10093
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10094
+  (0.0ms) SAVEPOINT active_record_1
10095
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'i3c9h5' AND "payola_sales"."id" != 1) LIMIT 1
10096
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10097
+  (0.0ms) SAVEPOINT active_record_1
10098
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'i3c9h5' AND "payola_sales"."id" != 1) LIMIT 1
10099
+ SQL (0.1ms) UPDATE "payola_sales" SET "error" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["error", "The card was declined"], ["updated_at", "2014-10-05 21:36:07.540176"]]
10100
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10101
+  (0.0ms) SAVEPOINT active_record_1
10102
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10103
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10104
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10105
+  (0.7ms) rollback transaction
10106
+  (0.0ms) begin transaction
10107
+  (0.0ms) rollback transaction
10108
+  (0.0ms) begin transaction
10109
+  (0.1ms) rollback transaction
10110
+  (0.1ms) begin transaction
10111
+  (0.0ms) rollback transaction
10112
+  (0.0ms) begin transaction
10113
+  (0.1ms) rollback transaction
10114
+  (0.0ms) begin transaction
10115
+  (0.0ms) rollback transaction
10116
+  (0.0ms) begin transaction
10117
+  (0.0ms) rollback transaction
10118
+  (0.0ms) begin transaction
10119
+  (0.0ms) rollback transaction
10120
+  (0.0ms) begin transaction
10121
+  (0.0ms) SAVEPOINT active_record_1
10122
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-12' LIMIT 1
10123
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.556163"], ["name", "Foo"], ["permalink", "foo-12"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.556163"]]
10124
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10125
+  (0.0ms) SAVEPOINT active_record_1
10126
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10127
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10128
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'b2ta8n' LIMIT 1
10129
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.558854"], ["email", "test@example.com"], ["guid", "b2ta8n"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.558854"]]
10130
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10131
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'b2ta8n' AND "payola_sales"."id" != 1) LIMIT 1
10132
+  (0.0ms) SAVEPOINT active_record_1
10133
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-13' LIMIT 1
10134
+ SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.561730"], ["name", "Foo"], ["permalink", "foo-13"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.561730"]]
10135
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10136
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'b2ta8n' LIMIT 1
10137
+  (0.5ms) rollback transaction
10138
+  (0.1ms) begin transaction
10139
+  (0.0ms) SAVEPOINT active_record_1
10140
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-14' LIMIT 1
10141
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.567197"], ["name", "Foo"], ["permalink", "foo-14"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.567197"]]
10142
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10143
+  (0.0ms) SAVEPOINT active_record_1
10144
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10145
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10146
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '9vtjkc' LIMIT 1
10147
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.570343"], ["email", "test@example.com"], ["guid", "9vtjkc"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.570343"]]
10148
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10149
+  (0.1ms) SAVEPOINT active_record_1
10150
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10151
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10152
+  (0.5ms) rollback transaction
10153
+  (0.1ms) begin transaction
10154
+  (0.0ms) SAVEPOINT active_record_1
10155
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-15' LIMIT 1
10156
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.576108"], ["name", "Foo"], ["permalink", "foo-15"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.576108"]]
10157
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10158
+  (0.0ms) SAVEPOINT active_record_1
10159
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10160
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10161
+ Payola::Sale Exists (0.2ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'oge5t7' LIMIT 1
10162
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.579567"], ["email", "test@example.com"], ["guid", "oge5t7"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.579567"]]
10163
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10164
+  (0.0ms) SAVEPOINT active_record_1
10165
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'processing' WHERE "payola_sales"."id" = 1
10166
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10167
+  (0.4ms) rollback transaction
10168
+  (0.1ms) begin transaction
10169
+  (0.1ms) SAVEPOINT active_record_1
10170
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-16' LIMIT 1
10171
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.586632"], ["name", "Foo"], ["permalink", "foo-16"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.586632"]]
10172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10173
+  (0.0ms) SAVEPOINT active_record_1
10174
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10175
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10176
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'jrkg0h' LIMIT 1
10177
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.590122"], ["email", "test@example.com"], ["guid", "jrkg0h"], ["product_id", 1], ["product_type", "Product"], ["state", "finished"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.590122"]]
10178
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10179
+  (0.1ms) SAVEPOINT active_record_1
10180
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'refunded' WHERE "payola_sales"."id" = 1
10181
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10182
+  (0.5ms) rollback transaction
10183
+  (0.1ms) begin transaction
10184
+  (0.1ms) SAVEPOINT active_record_1
10185
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-17' LIMIT 1
10186
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.596623"], ["name", "Foo"], ["permalink", "foo-17"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.596623"]]
10187
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10188
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10189
+  (0.4ms) rollback transaction
10190
+  (0.0ms) begin transaction
10191
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10192
+  (0.1ms) rollback transaction
10193
+  (0.0ms) begin transaction
10194
+  (0.0ms) SAVEPOINT active_record_1
10195
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-18' LIMIT 1
10196
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.603952"], ["name", "Foo"], ["permalink", "foo-18"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.603952"]]
10197
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10198
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10199
+  (0.4ms) rollback transaction
10200
+  (0.0ms) begin transaction
10201
+  (0.0ms) SAVEPOINT active_record_1
10202
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-19' LIMIT 1
10203
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.609001"], ["name", "Foo"], ["permalink", "foo-19"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.609001"]]
10204
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10205
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10206
+  (0.4ms) rollback transaction
10207
+  (0.0ms) begin transaction
10208
+  (0.0ms) SAVEPOINT active_record_1
10209
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-20' LIMIT 1
10210
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.613868"], ["name", "Foo"], ["permalink", "foo-20"], ["price", 100], ["updated_at", "2014-10-05 21:36:07.613868"]]
10211
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10212
+  (0.0ms) SAVEPOINT active_record_1
10213
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10214
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10215
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '776h98' LIMIT 1
10216
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:07.616597"], ["email", "test@example.com"], ["guid", "776h98"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:07.616597"]]
10217
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10218
+  (0.1ms) SAVEPOINT active_record_1
10219
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10220
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10221
+  (0.5ms) rollback transaction
10222
+  (0.0ms) begin transaction
10223
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10224
+  (0.1ms) rollback transaction
10225
+  (0.0ms) begin transaction
10226
+  (0.0ms) SAVEPOINT active_record_1
10227
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10228
+ SQL (0.2ms) INSERT INTO "payola_stripe_webhooks" ("created_at", "stripe_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-05 21:36:07.627080"], ["stripe_id", "test_id"], ["updated_at", "2014-10-05 21:36:07.627080"]]
10229
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10230
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10231
+  (0.5ms) rollback transaction
10232
+  (0.0ms) begin transaction
10233
+  (0.0ms) rollback transaction
10234
+  (0.0ms) begin transaction
10235
+  (0.0ms) rollback transaction
10236
+  (3.1ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "email" varchar(255), "percent" integer, "created_at" datetime, "updated_at" datetime) 
10237
+  (0.9ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "percent_off" integer, "created_at" datetime, "updated_at" datetime)
10238
+  (1.1ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "guid" varchar(255), "product_id" integer, "product_type" varchar(255), "created_at" datetime, "updated_at" datetime, "state" varchar(255), "stripe_id" varchar(255), "stripe_token" varchar(255), "card_last4" varchar(255), "card_expiration" date, "card_type" varchar(255), "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar(255)) 
10239
+  (0.2ms) select sqlite_version(*)
10240
+  (1.2ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
10241
+  (0.3ms) SELECT sql
10242
+ FROM sqlite_master
10243
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10244
+ UNION ALL
10245
+ SELECT sql
10246
+ FROM sqlite_temp_master
10247
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10248
+
10249
+  (1.2ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
10250
+  (0.1ms) SELECT sql
10251
+ FROM sqlite_master
10252
+ WHERE name='index_payola_sales_on_email' AND type='index'
10253
+ UNION ALL
10254
+ SELECT sql
10255
+ FROM sqlite_temp_master
10256
+ WHERE name='index_payola_sales_on_email' AND type='index'
10257
+
10258
+  (0.1ms)  SELECT sql
10259
+ FROM sqlite_master
10260
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10261
+ UNION ALL
10262
+ SELECT sql
10263
+ FROM sqlite_temp_master
10264
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10265
+ 
10266
+  (0.9ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
10267
+  (0.1ms)  SELECT sql
10268
+ FROM sqlite_master
10269
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10270
+ UNION ALL
10271
+ SELECT sql
10272
+ FROM sqlite_temp_master
10273
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10274
+ 
10275
+  (0.1ms) SELECT sql
10276
+ FROM sqlite_master
10277
+ WHERE name='index_payola_sales_on_email' AND type='index'
10278
+ UNION ALL
10279
+ SELECT sql
10280
+ FROM sqlite_temp_master
10281
+ WHERE name='index_payola_sales_on_email' AND type='index'
10282
+
10283
+  (0.1ms)  SELECT sql
10284
+ FROM sqlite_master
10285
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10286
+ UNION ALL
10287
+ SELECT sql
10288
+ FROM sqlite_temp_master
10289
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10290
+ 
10291
+  (0.9ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
10292
+  (0.1ms)  SELECT sql
10293
+ FROM sqlite_master
10294
+ WHERE name='index_payola_sales_on_product' AND type='index'
10295
+ UNION ALL
10296
+ SELECT sql
10297
+ FROM sqlite_temp_master
10298
+ WHERE name='index_payola_sales_on_product' AND type='index'
10299
+ 
10300
+  (0.1ms) SELECT sql
10301
+ FROM sqlite_master
10302
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10303
+ UNION ALL
10304
+ SELECT sql
10305
+ FROM sqlite_temp_master
10306
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10307
+
10308
+  (0.1ms)  SELECT sql
10309
+ FROM sqlite_master
10310
+ WHERE name='index_payola_sales_on_email' AND type='index'
10311
+ UNION ALL
10312
+ SELECT sql
10313
+ FROM sqlite_temp_master
10314
+ WHERE name='index_payola_sales_on_email' AND type='index'
10315
+ 
10316
+  (0.1ms) SELECT sql
10317
+ FROM sqlite_master
10318
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10319
+ UNION ALL
10320
+ SELECT sql
10321
+ FROM sqlite_temp_master
10322
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10323
+
10324
+  (18.4ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
10325
+  (1.7ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "created_at" datetime, "updated_at" datetime)
10326
+  (1.0ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "price" integer, "created_at" datetime, "updated_at" datetime) 
10327
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
10328
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
10329
+  (0.1ms) SELECT version FROM "schema_migrations"
10330
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
10331
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
10332
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
10333
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
10334
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
10335
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
10336
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10337
+  (0.1ms) begin transaction
10338
+  (0.1ms) SAVEPOINT active_record_1
10339
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-1' LIMIT 1
10340
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.198789"], ["name", "Foo"], ["permalink", "foo-1"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.198789"]]
10341
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10342
+  (1.9ms) rollback transaction
10343
+  (0.1ms) begin transaction
10344
+  (0.0ms) SAVEPOINT active_record_1
10345
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-2' LIMIT 1
10346
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.272179"], ["name", "Foo"], ["permalink", "foo-2"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.272179"]]
10347
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10348
+  (0.1ms) SAVEPOINT active_record_1
10349
+ Payola::Affiliate Exists (0.1ms) SELECT 1 AS one FROM "payola_affiliates" WHERE "payola_affiliates"."code" = 'MyString' LIMIT 1
10350
+ SQL (0.9ms) INSERT INTO "payola_affiliates" ("code", "created_at", "email", "percent", "updated_at") VALUES (?, ?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:41.281174"], ["email", "foo@example.com"], ["percent", 100], ["updated_at", "2014-10-05 21:36:41.281174"]]
10351
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10352
+ Payola::Affiliate Load (0.1ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE "payola_affiliates"."id" = ? LIMIT 1 [["id", 1]]
10353
+  (0.5ms) rollback transaction
10354
+  (0.1ms) begin transaction
10355
+  (0.0ms) SAVEPOINT active_record_1
10356
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-3' LIMIT 1
10357
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.290410"], ["name", "Foo"], ["permalink", "foo-3"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.290410"]]
10358
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10359
+  (0.1ms) SAVEPOINT active_record_1
10360
+ Payola::Coupon Exists (0.1ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
10361
+ SQL (0.6ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:41.297988"], ["percent_off", 1], ["updated_at", "2014-10-05 21:36:41.297988"]]
10362
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10363
+  (0.6ms) rollback transaction
10364
+  (0.1ms) begin transaction
10365
+  (0.1ms) SAVEPOINT active_record_1
10366
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-4' LIMIT 1
10367
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.308109"], ["name", "Foo"], ["permalink", "foo-4"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.308109"]]
10368
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10369
+  (0.0ms) SAVEPOINT active_record_1
10370
+ Payola::Coupon Exists (0.0ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
10371
+ SQL (0.2ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:36:41.310229"], ["percent_off", 1], ["updated_at", "2014-10-05 21:36:41.310229"]]
10372
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10373
+  (0.5ms) rollback transaction
10374
+  (0.0ms) begin transaction
10375
+  (0.0ms) rollback transaction
10376
+  (0.0ms) begin transaction
10377
+  (0.0ms) rollback transaction
10378
+  (0.0ms) begin transaction
10379
+  (0.0ms) SAVEPOINT active_record_1
10380
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-5' LIMIT 1
10381
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.316472"], ["name", "Foo"], ["permalink", "foo-5"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.316472"]]
10382
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10383
+  (0.0ms) SAVEPOINT active_record_1
10384
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10385
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10386
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '2sbg9d' LIMIT 1
10387
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.320015"], ["email", "test@example.com"], ["guid", "2sbg9d"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.320015"]]
10388
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10389
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '2sbg9d' AND "payola_sales"."id" != 1) LIMIT 1
10390
+  (0.1ms) SAVEPOINT active_record_1
10391
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-6' LIMIT 1
10392
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.326153"], ["name", "Foo"], ["permalink", "foo-6"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.326153"]]
10393
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10394
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '2sbg9d' LIMIT 1
10395
+  (0.7ms) rollback transaction
10396
+  (0.1ms) begin transaction
10397
+  (0.1ms) SAVEPOINT active_record_1
10398
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-7' LIMIT 1
10399
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.336115"], ["name", "Foo"], ["permalink", "foo-7"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.336115"]]
10400
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10401
+  (0.0ms) SAVEPOINT active_record_1
10402
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10403
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10404
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'a66216' LIMIT 1
10405
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.338815"], ["email", "test@example.com"], ["guid", "a66216"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.338815"]]
10406
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10407
+  (0.0ms) SAVEPOINT active_record_1
10408
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10409
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10410
+  (0.6ms) rollback transaction
10411
+  (0.0ms) begin transaction
10412
+  (0.0ms) SAVEPOINT active_record_1
10413
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-8' LIMIT 1
10414
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.349247"], ["name", "Foo"], ["permalink", "foo-8"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.349247"]]
10415
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10416
+  (0.0ms) SAVEPOINT active_record_1
10417
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10418
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10419
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '8q7232' LIMIT 1
10420
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.351989"], ["email", "test@example.com"], ["guid", "8q7232"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.351989"]]
10421
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10422
+  (0.0ms) SAVEPOINT active_record_1
10423
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10424
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10425
+  (0.5ms) rollback transaction
10426
+  (0.1ms) begin transaction
10427
+  (0.1ms) SAVEPOINT active_record_1
10428
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-9' LIMIT 1
10429
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.395258"], ["name", "Foo"], ["permalink", "foo-9"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.395258"]]
10430
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10431
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10432
+  (0.4ms) rollback transaction
10433
+  (0.1ms) begin transaction
10434
+  (0.0ms) SAVEPOINT active_record_1
10435
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-10' LIMIT 1
10436
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.400258"], ["name", "Foo"], ["permalink", "foo-10"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.400258"]]
10437
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10438
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10439
+  (0.4ms) rollback transaction
10440
+  (0.0ms) begin transaction
10441
+  (0.0ms) SAVEPOINT active_record_1
10442
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-11' LIMIT 1
10443
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.405788"], ["name", "Foo"], ["permalink", "foo-11"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.405788"]]
10444
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10445
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10446
+  (0.4ms) rollback transaction
10447
+  (0.0ms) begin transaction
10448
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10449
+  (0.0ms) rollback transaction
10450
+  (0.0ms) begin transaction
10451
+  (0.0ms) SAVEPOINT active_record_1
10452
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-12' LIMIT 1
10453
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.413994"], ["name", "Foo"], ["permalink", "foo-12"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.413994"]]
10454
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10455
+  (0.0ms) SAVEPOINT active_record_1
10456
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10457
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10458
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'p5r7t0' LIMIT 1
10459
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.416588"], ["email", "test@example.com"], ["guid", "p5r7t0"], ["product_id", 1], ["product_type", "Product"], ["state", "finished"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.416588"]]
10460
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10461
+  (0.0ms) SAVEPOINT active_record_1
10462
+ SQL (0.2ms) UPDATE "payola_sales" SET "state" = 'refunded' WHERE "payola_sales"."id" = 1
10463
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10464
+  (0.6ms) rollback transaction
10465
+  (0.0ms) begin transaction
10466
+  (0.0ms) SAVEPOINT active_record_1
10467
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-13' LIMIT 1
10468
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.422762"], ["name", "Foo"], ["permalink", "foo-13"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.422762"]]
10469
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10470
+  (0.0ms) SAVEPOINT active_record_1
10471
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10472
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10473
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'i1qdqa' LIMIT 1
10474
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.425340"], ["email", "test@example.com"], ["guid", "i1qdqa"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.425340"]]
10475
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10476
+  (0.0ms) SAVEPOINT active_record_1
10477
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'processing' WHERE "payola_sales"."id" = 1
10478
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10479
+  (0.7ms) rollback transaction
10480
+  (0.1ms) begin transaction
10481
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-14' LIMIT 1
10482
+  (0.1ms) rollback transaction
10483
+  (0.0ms) begin transaction
10484
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'f' LIMIT 1
10485
+  (0.1ms) rollback transaction
10486
+  (0.0ms) begin transaction
10487
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-15' LIMIT 1
10488
+  (0.0ms) rollback transaction
10489
+  (0.0ms) begin transaction
10490
+  (0.0ms) rollback transaction
10491
+  (0.0ms) begin transaction
10492
+  (0.0ms) rollback transaction
10493
+  (0.0ms) begin transaction
10494
+  (0.0ms) rollback transaction
10495
+  (0.0ms) begin transaction
10496
+  (0.0ms) rollback transaction
10497
+  (0.0ms) begin transaction
10498
+  (0.0ms) rollback transaction
10499
+  (0.0ms) begin transaction
10500
+  (0.0ms) rollback transaction
10501
+  (0.0ms) begin transaction
10502
+  (0.0ms) rollback transaction
10503
+  (0.0ms) begin transaction
10504
+  (0.0ms) SAVEPOINT active_record_1
10505
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-17' LIMIT 1
10506
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.445821"], ["name", "Foo"], ["permalink", "foo-17"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.445821"]]
10507
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10508
+  (0.0ms) SAVEPOINT active_record_1
10509
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10510
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10511
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '1alo8d' LIMIT 1
10512
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.448364"], ["email", "test@example.com"], ["guid", "1alo8d"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.448364"]]
10513
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10514
+  (0.0ms) SAVEPOINT active_record_1
10515
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '1alo8d' AND "payola_sales"."id" != 1) LIMIT 1
10516
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10517
+  (0.1ms) SAVEPOINT active_record_1
10518
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '1alo8d' AND "payola_sales"."id" != 1) LIMIT 1
10519
+ SQL (0.2ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:41.452531"]]
10520
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10521
+  (0.0ms) SAVEPOINT active_record_1
10522
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10523
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10524
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10525
+  (0.5ms) rollback transaction
10526
+  (0.1ms) begin transaction
10527
+  (0.1ms) SAVEPOINT active_record_1
10528
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-18' LIMIT 1
10529
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.459897"], ["name", "Foo"], ["permalink", "foo-18"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.459897"]]
10530
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10531
+  (0.1ms) SAVEPOINT active_record_1
10532
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10533
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10534
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'mt56q8' LIMIT 1
10535
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.463435"], ["email", "test@example.com"], ["guid", "mt56q8"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.463435"]]
10536
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10537
+  (0.0ms) SAVEPOINT active_record_1
10538
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'mt56q8' AND "payola_sales"."id" != 1) LIMIT 1
10539
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10540
+  (0.0ms) SAVEPOINT active_record_1
10541
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'mt56q8' AND "payola_sales"."id" != 1) LIMIT 1
10542
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:41.467426"]]
10543
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10544
+  (0.0ms) SAVEPOINT active_record_1
10545
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10546
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10547
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10548
+  (0.6ms) rollback transaction
10549
+  (0.0ms) begin transaction
10550
+  (0.0ms) SAVEPOINT active_record_1
10551
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-19' LIMIT 1
10552
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.472856"], ["name", "Foo"], ["permalink", "foo-19"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.472856"]]
10553
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10554
+  (0.0ms) SAVEPOINT active_record_1
10555
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10556
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10557
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'e7olcj' LIMIT 1
10558
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.475403"], ["email", "test@example.com"], ["guid", "e7olcj"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.475403"]]
10559
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10560
+  (0.0ms) SAVEPOINT active_record_1
10561
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'e7olcj' AND "payola_sales"."id" != 1) LIMIT 1
10562
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10563
+  (0.0ms) SAVEPOINT active_record_1
10564
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'e7olcj' AND "payola_sales"."id" != 1) LIMIT 1
10565
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:36:41.479010"]]
10566
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10567
+  (0.0ms) SAVEPOINT active_record_1
10568
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10569
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10570
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10571
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10572
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10573
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10574
+  (0.8ms) rollback transaction
10575
+  (0.2ms) begin transaction
10576
+  (0.0ms) SAVEPOINT active_record_1
10577
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-20' LIMIT 1
10578
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.486619"], ["name", "Foo"], ["permalink", "foo-20"], ["price", 100], ["updated_at", "2014-10-05 21:36:41.486619"]]
10579
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10580
+  (0.0ms) SAVEPOINT active_record_1
10581
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10582
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10583
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'iubp9b' LIMIT 1
10584
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:36:41.489193"], ["email", "test@example.com"], ["guid", "iubp9b"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:36:41.489193"]]
10585
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10586
+  (0.0ms) SAVEPOINT active_record_1
10587
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'iubp9b' AND "payola_sales"."id" != 1) LIMIT 1
10588
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10589
+  (0.0ms) SAVEPOINT active_record_1
10590
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'iubp9b' AND "payola_sales"."id" != 1) LIMIT 1
10591
+ SQL (0.1ms) UPDATE "payola_sales" SET "error" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["error", "The card was declined"], ["updated_at", "2014-10-05 21:36:41.492609"]]
10592
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10593
+  (0.0ms) SAVEPOINT active_record_1
10594
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10595
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10596
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10597
+  (0.6ms) rollback transaction
10598
+  (0.0ms) begin transaction
10599
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10600
+  (0.1ms) rollback transaction
10601
+  (0.0ms) begin transaction
10602
+  (0.0ms) SAVEPOINT active_record_1
10603
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10604
+ SQL (0.2ms) INSERT INTO "payola_stripe_webhooks" ("created_at", "stripe_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-05 21:36:41.502361"], ["stripe_id", "test_id"], ["updated_at", "2014-10-05 21:36:41.502361"]]
10605
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10606
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10607
+  (0.4ms) rollback transaction
10608
+  (0.0ms) begin transaction
10609
+  (0.0ms) rollback transaction
10610
+  (0.0ms) begin transaction
10611
+  (0.0ms) rollback transaction
10612
+  (0.0ms) begin transaction
10613
+  (0.1ms) rollback transaction
10614
+  (0.0ms) begin transaction
10615
+  (0.0ms) rollback transaction
10616
+  (0.0ms) begin transaction
10617
+  (0.0ms) rollback transaction
10618
+  (0.0ms) begin transaction
10619
+  (0.0ms) rollback transaction
10620
+  (2.7ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "email" varchar(255), "percent" integer, "created_at" datetime, "updated_at" datetime) 
10621
+  (1.1ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "percent_off" integer, "created_at" datetime, "updated_at" datetime)
10622
+  (0.8ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "guid" varchar(255), "product_id" integer, "product_type" varchar(255), "created_at" datetime, "updated_at" datetime, "state" varchar(255), "stripe_id" varchar(255), "stripe_token" varchar(255), "card_last4" varchar(255), "card_expiration" date, "card_type" varchar(255), "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar(255)) 
10623
+  (0.2ms) select sqlite_version(*)
10624
+  (1.0ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
10625
+  (0.1ms) SELECT sql
10626
+ FROM sqlite_master
10627
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10628
+ UNION ALL
10629
+ SELECT sql
10630
+ FROM sqlite_temp_master
10631
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10632
+
10633
+  (0.8ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
10634
+  (0.1ms) SELECT sql
10635
+ FROM sqlite_master
10636
+ WHERE name='index_payola_sales_on_email' AND type='index'
10637
+ UNION ALL
10638
+ SELECT sql
10639
+ FROM sqlite_temp_master
10640
+ WHERE name='index_payola_sales_on_email' AND type='index'
10641
+
10642
+  (0.1ms)  SELECT sql
10643
+ FROM sqlite_master
10644
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10645
+ UNION ALL
10646
+ SELECT sql
10647
+ FROM sqlite_temp_master
10648
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10649
+ 
10650
+  (0.7ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
10651
+  (0.1ms)  SELECT sql
10652
+ FROM sqlite_master
10653
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10654
+ UNION ALL
10655
+ SELECT sql
10656
+ FROM sqlite_temp_master
10657
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10658
+ 
10659
+  (0.1ms) SELECT sql
10660
+ FROM sqlite_master
10661
+ WHERE name='index_payola_sales_on_email' AND type='index'
10662
+ UNION ALL
10663
+ SELECT sql
10664
+ FROM sqlite_temp_master
10665
+ WHERE name='index_payola_sales_on_email' AND type='index'
10666
+
10667
+  (0.1ms)  SELECT sql
10668
+ FROM sqlite_master
10669
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10670
+ UNION ALL
10671
+ SELECT sql
10672
+ FROM sqlite_temp_master
10673
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10674
+ 
10675
+  (0.8ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
10676
+  (0.1ms)  SELECT sql
10677
+ FROM sqlite_master
10678
+ WHERE name='index_payola_sales_on_product' AND type='index'
10679
+ UNION ALL
10680
+ SELECT sql
10681
+ FROM sqlite_temp_master
10682
+ WHERE name='index_payola_sales_on_product' AND type='index'
10683
+ 
10684
+  (0.1ms) SELECT sql
10685
+ FROM sqlite_master
10686
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10687
+ UNION ALL
10688
+ SELECT sql
10689
+ FROM sqlite_temp_master
10690
+ WHERE name='index_payola_sales_on_guid' AND type='index'
10691
+
10692
+  (0.1ms)  SELECT sql
10693
+ FROM sqlite_master
10694
+ WHERE name='index_payola_sales_on_email' AND type='index'
10695
+ UNION ALL
10696
+ SELECT sql
10697
+ FROM sqlite_temp_master
10698
+ WHERE name='index_payola_sales_on_email' AND type='index'
10699
+ 
10700
+  (0.1ms) SELECT sql
10701
+ FROM sqlite_master
10702
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10703
+ UNION ALL
10704
+ SELECT sql
10705
+ FROM sqlite_temp_master
10706
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
10707
+
10708
+  (0.7ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
10709
+  (0.8ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "created_at" datetime, "updated_at" datetime)
10710
+  (0.6ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "price" integer, "created_at" datetime, "updated_at" datetime) 
10711
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
10712
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
10713
+  (0.1ms) SELECT version FROM "schema_migrations"
10714
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
10715
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
10716
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
10717
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
10718
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
10719
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
10720
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10721
+  (0.1ms) begin transaction
10722
+  (0.1ms) rollback transaction
10723
+  (0.1ms) begin transaction
10724
+  (0.0ms) rollback transaction
10725
+  (0.0ms) begin transaction
10726
+  (0.1ms) SAVEPOINT active_record_1
10727
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-1' LIMIT 1
10728
+ SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.368573"], ["name", "Foo"], ["permalink", "foo-1"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.368573"]]
10729
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10730
+  (0.1ms) SAVEPOINT active_record_1
10731
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10732
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10733
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'j9qo2o' LIMIT 1
10734
+ SQL (1.0ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.382872"], ["email", "test@example.com"], ["guid", "j9qo2o"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.382872"]]
10735
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10736
+  (0.0ms) SAVEPOINT active_record_1
10737
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'j9qo2o' AND "payola_sales"."id" != 1) LIMIT 1
10738
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10739
+  (0.1ms) SAVEPOINT active_record_1
10740
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'j9qo2o' AND "payola_sales"."id" != 1) LIMIT 1
10741
+ SQL (0.2ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:47:52.389066"]]
10742
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10743
+  (0.0ms) SAVEPOINT active_record_1
10744
+ SQL (0.2ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10745
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10746
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10747
+  (1.7ms) rollback transaction
10748
+  (0.1ms) begin transaction
10749
+  (0.0ms) SAVEPOINT active_record_1
10750
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-2' LIMIT 1
10751
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.402496"], ["name", "Foo"], ["permalink", "foo-2"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.402496"]]
10752
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10753
+  (0.0ms) SAVEPOINT active_record_1
10754
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10755
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10756
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'k884ug' LIMIT 1
10757
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.405129"], ["email", "test@example.com"], ["guid", "k884ug"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.405129"]]
10758
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10759
+  (0.0ms) SAVEPOINT active_record_1
10760
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'k884ug' AND "payola_sales"."id" != 1) LIMIT 1
10761
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10762
+  (0.0ms) SAVEPOINT active_record_1
10763
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'k884ug' AND "payola_sales"."id" != 1) LIMIT 1
10764
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:47:52.408826"]]
10765
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10766
+  (0.0ms) SAVEPOINT active_record_1
10767
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10768
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10769
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10770
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10771
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10772
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10773
+  (0.5ms) rollback transaction
10774
+  (0.0ms) begin transaction
10775
+  (0.0ms) SAVEPOINT active_record_1
10776
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-3' LIMIT 1
10777
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.415090"], ["name", "Foo"], ["permalink", "foo-3"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.415090"]]
10778
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10779
+  (0.0ms) SAVEPOINT active_record_1
10780
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10781
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10782
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'af4u2o' LIMIT 1
10783
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.417892"], ["email", "test@example.com"], ["guid", "af4u2o"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.417892"]]
10784
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10785
+  (0.0ms) SAVEPOINT active_record_1
10786
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'af4u2o' AND "payola_sales"."id" != 1) LIMIT 1
10787
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10788
+  (0.0ms) SAVEPOINT active_record_1
10789
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'af4u2o' AND "payola_sales"."id" != 1) LIMIT 1
10790
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-10-05 21:47:52.421732"]]
10791
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10792
+  (0.1ms) SAVEPOINT active_record_1
10793
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10794
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10795
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10796
+  (0.5ms) rollback transaction
10797
+  (0.1ms) begin transaction
10798
+  (0.1ms) SAVEPOINT active_record_1
10799
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-4' LIMIT 1
10800
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.429006"], ["name", "Foo"], ["permalink", "foo-4"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.429006"]]
10801
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10802
+  (0.1ms) SAVEPOINT active_record_1
10803
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10804
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10805
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '256q6d' LIMIT 1
10806
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.432535"], ["email", "test@example.com"], ["guid", "256q6d"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.432535"]]
10807
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10808
+  (0.0ms) SAVEPOINT active_record_1
10809
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '256q6d' AND "payola_sales"."id" != 1) LIMIT 1
10810
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10811
+  (0.0ms) SAVEPOINT active_record_1
10812
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '256q6d' AND "payola_sales"."id" != 1) LIMIT 1
10813
+ SQL (0.1ms) UPDATE "payola_sales" SET "error" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["error", "The card was declined"], ["updated_at", "2014-10-05 21:47:52.436458"]]
10814
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10815
+  (0.0ms) SAVEPOINT active_record_1
10816
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10817
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10818
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
10819
+  (0.6ms) rollback transaction
10820
+  (0.0ms) begin transaction
10821
+  (0.0ms) rollback transaction
10822
+  (0.0ms) begin transaction
10823
+  (0.1ms) rollback transaction
10824
+  (0.0ms) begin transaction
10825
+  (0.0ms) rollback transaction
10826
+  (0.0ms) begin transaction
10827
+  (0.0ms) rollback transaction
10828
+  (0.0ms) begin transaction
10829
+  (0.1ms) rollback transaction
10830
+  (0.0ms) begin transaction
10831
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-5' LIMIT 1
10832
+  (0.1ms) rollback transaction
10833
+  (0.0ms) begin transaction
10834
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-6' LIMIT 1
10835
+  (0.1ms) rollback transaction
10836
+  (0.0ms) begin transaction
10837
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'f' LIMIT 1
10838
+  (0.1ms) rollback transaction
10839
+  (0.0ms) begin transaction
10840
+  (0.0ms) rollback transaction
10841
+  (0.0ms) begin transaction
10842
+  (0.0ms) rollback transaction
10843
+  (0.0ms) begin transaction
10844
+  (0.0ms) SAVEPOINT active_record_1
10845
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-8' LIMIT 1
10846
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.504953"], ["name", "Foo"], ["permalink", "foo-8"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.504953"]]
10847
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10848
+  (0.0ms) SAVEPOINT active_record_1
10849
+ Payola::Affiliate Exists (0.1ms) SELECT 1 AS one FROM "payola_affiliates" WHERE "payola_affiliates"."code" = 'MyString' LIMIT 1
10850
+ SQL (0.3ms) INSERT INTO "payola_affiliates" ("code", "created_at", "email", "percent", "updated_at") VALUES (?, ?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:47:52.512898"], ["email", "foo@example.com"], ["percent", 100], ["updated_at", "2014-10-05 21:47:52.512898"]]
10851
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10852
+ Payola::Affiliate Load (0.2ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE "payola_affiliates"."id" = ? LIMIT 1 [["id", 1]]
10853
+  (0.6ms) rollback transaction
10854
+  (0.1ms) begin transaction
10855
+  (0.0ms) SAVEPOINT active_record_1
10856
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-9' LIMIT 1
10857
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.523309"], ["name", "Foo"], ["permalink", "foo-9"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.523309"]]
10858
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10859
+  (0.4ms) rollback transaction
10860
+  (0.0ms) begin transaction
10861
+  (0.0ms) SAVEPOINT active_record_1
10862
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-10' LIMIT 1
10863
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.526990"], ["name", "Foo"], ["permalink", "foo-10"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.526990"]]
10864
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10865
+  (0.1ms) SAVEPOINT active_record_1
10866
+ Payola::Coupon Exists (0.1ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
10867
+ SQL (0.3ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:47:52.534900"], ["percent_off", 1], ["updated_at", "2014-10-05 21:47:52.534900"]]
10868
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10869
+  (0.4ms) rollback transaction
10870
+  (0.1ms) begin transaction
10871
+  (0.0ms) SAVEPOINT active_record_1
10872
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-11' LIMIT 1
10873
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.540954"], ["name", "Foo"], ["permalink", "foo-11"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.540954"]]
10874
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10875
+  (0.0ms) SAVEPOINT active_record_1
10876
+ Payola::Coupon Exists (0.1ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
10877
+ SQL (0.3ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-10-05 21:47:52.542903"], ["percent_off", 1], ["updated_at", "2014-10-05 21:47:52.542903"]]
10878
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10879
+  (0.4ms) rollback transaction
10880
+  (0.1ms) begin transaction
10881
+  (0.2ms) rollback transaction
10882
+  (0.1ms) begin transaction
10883
+  (0.0ms) rollback transaction
10884
+  (0.0ms) begin transaction
10885
+  (0.1ms) SAVEPOINT active_record_1
10886
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10887
+ SQL (0.2ms) INSERT INTO "payola_stripe_webhooks" ("created_at", "stripe_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-05 21:47:52.553738"], ["stripe_id", "test_id"], ["updated_at", "2014-10-05 21:47:52.553738"]]
10888
+  (0.2ms) RELEASE SAVEPOINT active_record_1
10889
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10890
+  (0.6ms) rollback transaction
10891
+  (0.1ms) begin transaction
10892
+ Payola::StripeWebhook Exists (0.2ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
10893
+  (0.1ms) rollback transaction
10894
+  (0.0ms) begin transaction
10895
+  (0.0ms) SAVEPOINT active_record_1
10896
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-12' LIMIT 1
10897
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.564211"], ["name", "Foo"], ["permalink", "foo-12"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.564211"]]
10898
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10899
+  (0.0ms) SAVEPOINT active_record_1
10900
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10901
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10902
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'n28rhu' LIMIT 1
10903
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.567352"], ["email", "test@example.com"], ["guid", "n28rhu"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.567352"]]
10904
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10905
+  (0.1ms) SAVEPOINT active_record_1
10906
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
10907
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10908
+  (0.6ms) rollback transaction
10909
+  (0.1ms) begin transaction
10910
+  (0.0ms) SAVEPOINT active_record_1
10911
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-13' LIMIT 1
10912
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.573469"], ["name", "Foo"], ["permalink", "foo-13"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.573469"]]
10913
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10914
+  (0.0ms) SAVEPOINT active_record_1
10915
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10916
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10917
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '3unt6s' LIMIT 1
10918
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.576107"], ["email", "test@example.com"], ["guid", "3unt6s"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.576107"]]
10919
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10920
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '3unt6s' AND "payola_sales"."id" != 1) LIMIT 1
10921
+  (0.1ms) SAVEPOINT active_record_1
10922
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-14' LIMIT 1
10923
+ SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.579437"], ["name", "Foo"], ["permalink", "foo-14"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.579437"]]
10924
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10925
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '3unt6s' LIMIT 1
10926
+  (0.6ms) rollback transaction
10927
+  (0.1ms) begin transaction
10928
+  (0.0ms) SAVEPOINT active_record_1
10929
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-15' LIMIT 1
10930
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.585378"], ["name", "Foo"], ["permalink", "foo-15"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.585378"]]
10931
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10932
+  (0.0ms) SAVEPOINT active_record_1
10933
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10934
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10935
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'etgrrr' LIMIT 1
10936
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.588325"], ["email", "test@example.com"], ["guid", "etgrrr"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.588325"]]
10937
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10938
+  (0.0ms) SAVEPOINT active_record_1
10939
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'processing' WHERE "payola_sales"."id" = 1
10940
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10941
+  (0.5ms) rollback transaction
10942
+  (0.0ms) begin transaction
10943
+  (0.0ms) SAVEPOINT active_record_1
10944
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-16' LIMIT 1
10945
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.593310"], ["name", "Foo"], ["permalink", "foo-16"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.593310"]]
10946
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10947
+  (0.0ms) SAVEPOINT active_record_1
10948
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10949
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10950
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '61c175' LIMIT 1
10951
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.595822"], ["email", "test@example.com"], ["guid", "61c175"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.595822"]]
10952
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10953
+  (0.0ms) SAVEPOINT active_record_1
10954
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
10955
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10956
+  (0.5ms) rollback transaction
10957
+  (0.1ms) begin transaction
10958
+  (0.1ms) SAVEPOINT active_record_1
10959
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-17' LIMIT 1
10960
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.602032"], ["name", "Foo"], ["permalink", "foo-17"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.602032"]]
10961
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10962
+  (0.0ms) SAVEPOINT active_record_1
10963
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10964
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10965
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '89e9e6' LIMIT 1
10966
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.604595"], ["email", "test@example.com"], ["guid", "89e9e6"], ["product_id", 1], ["product_type", "Product"], ["state", "finished"], ["stripe_token", "tok_test"], ["updated_at", "2014-10-05 21:47:52.604595"]]
10967
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10968
+  (0.1ms) SAVEPOINT active_record_1
10969
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'refunded' WHERE "payola_sales"."id" = 1
10970
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10971
+  (0.5ms) rollback transaction
10972
+  (0.1ms) begin transaction
10973
+  (0.0ms) SAVEPOINT active_record_1
10974
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-18' LIMIT 1
10975
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.610562"], ["name", "Foo"], ["permalink", "foo-18"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.610562"]]
10976
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10977
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10978
+  (0.4ms) rollback transaction
10979
+  (0.1ms) begin transaction
10980
+  (0.1ms) SAVEPOINT active_record_1
10981
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-19' LIMIT 1
10982
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.616117"], ["name", "Foo"], ["permalink", "foo-19"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.616117"]]
10983
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10984
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10985
+  (0.5ms) rollback transaction
10986
+  (0.0ms) begin transaction
10987
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10988
+  (0.1ms) rollback transaction
10989
+  (0.0ms) begin transaction
10990
+  (0.0ms) SAVEPOINT active_record_1
10991
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-20' LIMIT 1
10992
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-10-05 21:47:52.624873"], ["name", "Foo"], ["permalink", "foo-20"], ["price", 100], ["updated_at", "2014-10-05 21:47:52.624873"]]
10993
+  (0.0ms) RELEASE SAVEPOINT active_record_1
10994
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
10995
+  (0.4ms) rollback transaction
10996
+  (0.0ms) begin transaction
10997
+  (0.0ms) rollback transaction
10998
+  (0.0ms) begin transaction
10999
+  (0.0ms) rollback transaction
11000
+  (0.1ms) begin transaction
11001
+  (0.0ms) rollback transaction
11002
+  (0.0ms) begin transaction
11003
+  (0.0ms) rollback transaction