approvable 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +21 -0
  5. data/app/models/approvable/change_request.rb +57 -0
  6. data/db/migrate/20140807145534_create_approvable_change_requests.rb +14 -0
  7. data/lib/approvable/acts_as_approvable.rb +85 -0
  8. data/lib/approvable/engine.rb +41 -0
  9. data/lib/approvable/version.rb +3 -0
  10. data/lib/approvable.rb +4 -0
  11. data/spec/dummy/README.rdoc +28 -0
  12. data/spec/dummy/Rakefile +6 -0
  13. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  15. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  16. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  17. data/spec/dummy/app/models/listing.rb +3 -0
  18. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  19. data/spec/dummy/bin/bundle +3 -0
  20. data/spec/dummy/bin/rails +4 -0
  21. data/spec/dummy/bin/rake +4 -0
  22. data/spec/dummy/config/application.rb +29 -0
  23. data/spec/dummy/config/boot.rb +5 -0
  24. data/spec/dummy/config/database.yml +85 -0
  25. data/spec/dummy/config/environment.rb +5 -0
  26. data/spec/dummy/config/environments/development.rb +37 -0
  27. data/spec/dummy/config/environments/production.rb +82 -0
  28. data/spec/dummy/config/environments/test.rb +39 -0
  29. data/spec/dummy/config/initializers/assets.rb +8 -0
  30. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  31. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  32. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  33. data/spec/dummy/config/initializers/inflections.rb +16 -0
  34. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  35. data/spec/dummy/config/initializers/session_store.rb +3 -0
  36. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  37. data/spec/dummy/config/locales/en.yml +23 -0
  38. data/spec/dummy/config/routes.rb +4 -0
  39. data/spec/dummy/config/secrets.yml +22 -0
  40. data/spec/dummy/config.ru +4 -0
  41. data/spec/dummy/db/migrate/20140807144654_create_listings.rb +12 -0
  42. data/spec/dummy/db/schema.rb +28 -0
  43. data/spec/dummy/log/development.log +339 -0
  44. data/spec/dummy/log/test.log +33704 -0
  45. data/spec/dummy/public/404.html +67 -0
  46. data/spec/dummy/public/422.html +67 -0
  47. data/spec/dummy/public/500.html +66 -0
  48. data/spec/dummy/public/favicon.ico +0 -0
  49. data/spec/factories/change_requests.rb +50 -0
  50. data/spec/factories/listing.rb +15 -0
  51. data/spec/models/acts_as_approvable_spec.rb +192 -0
  52. data/spec/models/approvable/change_request_spec.rb +61 -0
  53. data/spec/rails_helper.rb +52 -0
  54. data/spec/spec_helper.rb +78 -0
  55. data/spec/support/factory_girl.rb +5 -0
  56. metadata +228 -0
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount Approvable::Engine => "/approvable"
4
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: ef50a51f74e80b71a9ce037e3e94cd45f34e7b14ab8cbe9ac6071f7f8b52207ee9ba0832ee99d48d350eab5924029528b83b1f7386743639dc2782245df717dd
15
+
16
+ test:
17
+ secret_key_base: 407e94361d6607c32f7bf0570a837f883b219c0a264b51c27d3a3759add6dbdfcbfedced02c127f7c4ccf65f85ee71bf8b1248c51071e5c544c10dec985a759b
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,12 @@
1
+ class CreateListings < ActiveRecord::Migration
2
+ def change
3
+ create_table :listings do |t|
4
+ t.string :title
5
+ t.text :description
6
+ t.string :image
7
+ t.boolean :deleted
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140807144654) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "listings", force: true do |t|
20
+ t.string "title"
21
+ t.text "description"
22
+ t.string "image"
23
+ t.boolean "deleted"
24
+ t.datetime "created_at"
25
+ t.datetime "updated_at"
26
+ end
27
+
28
+ end
@@ -0,0 +1,339 @@
1
+ ActiveRecord::SchemaMigration Load (38.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
+ Migrating to CreateListings (20140807144654)
3
+  (0.2ms) BEGIN
4
+  (85.7ms) CREATE TABLE "listings" ("id" serial primary key, "title" character varying(255), "description" text, "image" character varying(255), "deleted" boolean, "created_at" timestamp, "updated_at" timestamp) 
5
+ SQL (15.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807144654"]]
6
+  (19.5ms) COMMIT
7
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
8
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
9
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
16
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
+  (2.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
19
+  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
20
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
21
+ Migrating to CreateListings (20140807144654)
22
+  (0.2ms) BEGIN
23
+  (4.8ms) CREATE TABLE "listings" ("id" serial primary key, "title" character varying(255), "description" text, "image" character varying(255), "deleted" boolean, "created_at" timestamp, "updated_at" timestamp) 
24
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807144654"]]
25
+  (0.4ms) COMMIT
26
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
27
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
28
+ Migrating to CreateApprovableChangeRequests (20140807145405)
29
+  (0.2ms) BEGIN
30
+  (80.5ms) CREATE TABLE "approvable_change_requests" ("id" serial primary key, "approvable_type" character varying(255), "approvable_id" integer, "changed_attributes" json, "submitted_at" timestamp, "approved_at" timestamp, "created_at" timestamp, "updated_at" timestamp) 
31
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807145405"]]
32
+  (18.3ms) COMMIT
33
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
34
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
35
+ Migrating to AddRejectedAtToApprovableChangeRequests (20140807153844)
36
+  (0.2ms) BEGIN
37
+  (1.3ms) ALTER TABLE "approvable_change_requests" ADD COLUMN "rejected_at" timestamp
38
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807153844"]]
39
+  (42.8ms) COMMIT
40
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
41
+  (18.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
42
+  (58.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
43
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
+ Migrating to CreateListings (20140807144654)
45
+  (0.2ms) BEGIN
46
+  (86.8ms) CREATE TABLE "listings" ("id" serial primary key, "title" character varying(255), "description" text, "image" character varying(255), "deleted" boolean, "created_at" timestamp, "updated_at" timestamp) 
47
+ SQL (15.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807144654"]]
48
+  (35.6ms) COMMIT
49
+ Migrating to CreateApprovableChangeRequests (20140807145534)
50
+  (15.4ms) BEGIN
51
+  (70.2ms) CREATE TABLE "approvable_change_requests" ("id" serial primary key, "approvable_type" character varying(255), "approvable_id" integer, "requested_changes" json, "submitted_at" timestamp, "approved_at" timestamp, "rejected_at" timestamp, "created_at" timestamp, "updated_at" timestamp) 
52
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807145534"]]
53
+  (15.7ms) COMMIT
54
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
55
+  (0.2ms) BEGIN
56
+ SQL (0.7ms) INSERT INTO "listings" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-08-07 16:47:55.090470"], ["title", "hi"], ["updated_at", "2014-08-07 16:47:55.090470"]]
57
+  (16.2ms) COMMIT
58
+ Approvable::ChangeRequest Load (0.6ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND "approvable_change_requests"."approved_at" IS NULL LIMIT 1 [["approvable_id", 149], ["approvable_type", "Listing"]]
59
+  (0.2ms) BEGIN
60
+ SQL (0.4ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["approvable_id", 149], ["approvable_type", "Listing"], ["created_at", "2014-08-07 16:50:11.655986"], ["updated_at", "2014-08-07 16:50:11.655986"]]
61
+  (20.0ms) COMMIT
62
+  (0.2ms) BEGIN
63
+ SQL (0.6ms) INSERT INTO "listings" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-08-07 17:08:49.184884"], ["title", "hi"], ["updated_at", "2014-08-07 17:08:49.184884"]]
64
+  (62.0ms) COMMIT
65
+ Listing Load (37.5ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
66
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
67
+ Migrating to AddStateToApprovableChangeRequests (20140807180913)
68
+  (0.4ms) BEGIN
69
+  (430.1ms) ALTER TABLE "approvable_change_requests" ADD COLUMN "state" character varying(255)
70
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807180913"]]
71
+  (128.1ms) COMMIT
72
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
73
+ Listing Load (1.2ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
74
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
75
+  (0.2ms) BEGIN
76
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
77
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
78
+ SQL (0.5ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["approvable_id", 216], ["approvable_type", "Listing"], ["created_at", "2014-08-08 09:46:30.450523"], ["state", "pending"], ["updated_at", "2014-08-08 09:46:30.450523"]]
79
+  (0.8ms) COMMIT
80
+  (0.2ms) BEGIN
81
+ Listing Load (0.4ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
82
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
83
+  (0.2ms) COMMIT
84
+ Listing Load (1.0ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
85
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
86
+  (0.2ms) BEGIN
87
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
88
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
89
+ SQL (0.3ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1378 [["requested_changes", "{\"title\":\"bye\"}"], ["updated_at", "2014-08-08 09:47:24.717014"]]
90
+  (0.4ms) COMMIT
91
+  (0.1ms) BEGIN
92
+  (0.1ms) COMMIT
93
+  (0.2ms) BEGIN
94
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1378 [["state", "submitted"], ["updated_at", "2014-08-08 09:47:43.510931"]]
95
+  (0.5ms) COMMIT
96
+  (0.2ms) BEGIN
97
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1378 [["requested_changes", "{}"], ["updated_at", "2014-08-08 09:47:52.341563"]]
98
+  (0.5ms) COMMIT
99
+  (0.2ms) BEGIN
100
+  (0.1ms) COMMIT
101
+  (0.2ms) BEGIN
102
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1378 [["requested_changes", "{\"title\":\"bye\"}"], ["updated_at", "2014-08-08 09:48:39.143884"]]
103
+  (0.5ms) COMMIT
104
+  (0.1ms) BEGIN
105
+  (0.1ms) COMMIT
106
+  (0.1ms) BEGIN
107
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1378 [["state", "approved"], ["updated_at", "2014-08-08 09:54:28.546524"]]
108
+  (0.6ms) COMMIT
109
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."id" = $1 LIMIT 1 [["id", 1378]]
110
+ Listing Load (1.1ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
111
+ Approvable::ChangeRequest Load (0.6ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
112
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" ORDER BY "approvable_change_requests"."id" DESC LIMIT 1
113
+  (0.4ms) BEGIN
114
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
115
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
116
+  (0.2ms) ROLLBACK
117
+ Approvable::ChangeRequest Load (1.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" ORDER BY "approvable_change_requests"."id" DESC LIMIT 1
118
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" ORDER BY "approvable_change_requests"."id" DESC LIMIT 1
119
+ Listing Load (0.5ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
120
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
121
+  (0.2ms) BEGIN
122
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
123
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
124
+  (0.2ms) ROLLBACK
125
+  (0.1ms) BEGIN
126
+  (0.2ms) ROLLBACK
127
+ Listing Load (0.7ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
128
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
129
+  (0.3ms) BEGIN
130
+ Listing Load (0.4ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
131
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
132
+ SQL (0.6ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 216], ["approvable_type", "Listing"], ["created_at", "2014-08-08 10:19:07.692596"], ["requested_changes", "{\"title\":\"bye\"}"], ["state", "pending"], ["updated_at", "2014-08-08 10:19:07.692596"]]
133
+  (90.7ms) COMMIT
134
+  (0.2ms) BEGIN
135
+  (0.2ms) COMMIT
136
+  (0.1ms) BEGIN
137
+ SQL (0.3ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1379 [["state", "submitted"], ["updated_at", "2014-08-08 10:19:17.938449"]]
138
+  (7.8ms) COMMIT
139
+  (0.3ms) BEGIN
140
+  (0.3ms) ROLLBACK
141
+  (0.2ms) BEGIN
142
+  (0.2ms) COMMIT
143
+ Listing Load (0.7ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
144
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
145
+  (0.2ms) BEGIN
146
+ Listing Load (0.2ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
147
+ Approvable::ChangeRequest Load (0.2ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
148
+  (0.1ms) COMMIT
149
+  (0.3ms) BEGIN
150
+  (0.4ms) ROLLBACK
151
+ Listing Load (0.8ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
152
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
153
+  (0.2ms) BEGIN
154
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
155
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
156
+  (0.1ms) COMMIT
157
+  (0.2ms) BEGIN
158
+  (0.3ms) COMMIT
159
+ Listing Load (0.6ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
160
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
161
+ Listing Load (0.7ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
162
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
163
+  (0.2ms) BEGIN
164
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
165
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
166
+  (0.2ms) ROLLBACK
167
+  (0.4ms) BEGIN
168
+ SQL (0.5ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "state" = $2, "updated_at" = $3 WHERE "approvable_change_requests"."id" = 1379 [["requested_changes", "{}"], ["state", "rejected"], ["updated_at", "2014-08-08 10:40:54.186390"]]
169
+  (210.6ms) COMMIT
170
+  (0.5ms) BEGIN
171
+  (0.2ms) ROLLBACK
172
+  (0.2ms) BEGIN
173
+  (0.2ms) ROLLBACK
174
+ Approvable::ChangeRequest Load (0.6ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."id" = $1 LIMIT 1 [["id", 1379]]
175
+  (0.4ms) BEGIN
176
+ Listing Load (0.4ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
177
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
178
+  (0.4ms) ROLLBACK
179
+ Listing Load (0.9ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
180
+ Approvable::ChangeRequest Load (0.4ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
181
+  (0.3ms) BEGIN
182
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
183
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
184
+  (0.2ms) ROLLBACK
185
+ Listing Load (1.2ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
186
+ Listing Load (0.9ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
187
+ Approvable::ChangeRequest Load (90.1ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
188
+  (0.2ms) BEGIN
189
+ Listing Load (0.5ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
190
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
191
+  (0.3ms) ROLLBACK
192
+  (0.3ms) BEGIN
193
+  (0.2ms) ROLLBACK
194
+  (0.4ms) BEGIN
195
+  (0.3ms) ROLLBACK
196
+  (0.3ms) BEGIN
197
+  (0.3ms) ROLLBACK
198
+ Listing Load (0.8ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
199
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
200
+  (0.2ms) BEGIN
201
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
202
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
203
+ SQL (0.5ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "state" = $2, "updated_at" = $3 WHERE "approvable_change_requests"."id" = 1379 [["requested_changes", "{\"title\":\"hai again\"}"], ["state", "pending"], ["updated_at", "2014-08-08 11:26:57.908505"]]
204
+  (137.6ms) COMMIT
205
+  (0.3ms) BEGIN
206
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1379 [["state", "submitted"], ["updated_at", "2014-08-08 11:27:14.028230"]]
207
+  (6.3ms) COMMIT
208
+  (0.2ms) BEGIN
209
+  (0.2ms) ROLLBACK
210
+  (0.2ms) BEGIN
211
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "state" = $2, "updated_at" = $3 WHERE "approvable_change_requests"."id" = 1379 [["requested_changes", "{\"title\":\"boo\"}"], ["state", "pending"], ["updated_at", "2014-08-08 11:28:05.230532"]]
212
+  (2.5ms) COMMIT
213
+  (0.2ms) BEGIN
214
+  (0.3ms) COMMIT
215
+  (0.2ms) BEGIN
216
+ SQL (0.3ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1379 [["requested_changes", "{\"title\":\"bye\"}"], ["updated_at", "2014-08-08 11:28:18.324713"]]
217
+  (31.7ms) COMMIT
218
+  (0.1ms) BEGIN
219
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1379 [["state", "submitted"], ["updated_at", "2014-08-08 11:28:29.754016"]]
220
+  (61.1ms) COMMIT
221
+  (0.4ms) BEGIN
222
+  (0.3ms) ROLLBACK
223
+  (0.2ms) BEGIN
224
+  (0.3ms) ROLLBACK
225
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."id" = $1 LIMIT 1 [["id", 1379]]
226
+ Listing Load (0.3ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
227
+ Approvable::ChangeRequest Load (0.6ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
228
+  (0.3ms) BEGIN
229
+ Listing Load (0.5ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
230
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
231
+ SQL (0.4ms) UPDATE "listings" SET "title" = $1, "updated_at" = $2 WHERE "listings"."id" = 216 [["title", "bye"], ["updated_at", "2014-08-08 11:30:17.561760"]]
232
+  (21.5ms) COMMIT
233
+  (0.3ms) BEGIN
234
+ SQL (0.6ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1379 [["state", "approved"], ["updated_at", "2014-08-08 11:30:17.588053"]]
235
+  (15.6ms) COMMIT
236
+ Listing Load (0.7ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
237
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
238
+  (0.2ms) BEGIN
239
+ Listing Load (0.2ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
240
+ Approvable::ChangeRequest Load (0.2ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
241
+ SQL (0.4ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 216], ["approvable_type", "Listing"], ["created_at", "2014-08-08 11:32:17.691400"], ["requested_changes", "{\"title\":\"hi\"}"], ["state", "pending"], ["updated_at", "2014-08-08 11:32:17.691400"]]
242
+  (25.5ms) COMMIT
243
+  (0.2ms) BEGIN
244
+  (0.4ms) COMMIT
245
+ Listing Load (0.5ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
246
+ Approvable::ChangeRequest Load (0.6ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
247
+  (0.3ms) BEGIN
248
+ Listing Load (0.5ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
249
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
250
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1408 [["state", "submitted"], ["updated_at", "2014-08-08 11:35:19.814473"]]
251
+  (25.9ms) COMMIT
252
+  (0.2ms) BEGIN
253
+  (0.2ms) ROLLBACK
254
+  (0.3ms) BEGIN
255
+  (0.2ms) ROLLBACK
256
+  (0.4ms) BEGIN
257
+  (0.3ms) ROLLBACK
258
+  (0.2ms) BEGIN
259
+  (0.3ms) ROLLBACK
260
+  (0.5ms) BEGIN
261
+  (0.3ms) ROLLBACK
262
+ Listing Load (0.8ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
263
+ Approvable::ChangeRequest Load (0.7ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
264
+  (0.1ms) BEGIN
265
+ Listing Load (0.2ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
266
+ Approvable::ChangeRequest Load (0.2ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
267
+  (0.1ms) ROLLBACK
268
+ Listing Load (1.3ms) SELECT "listings".* FROM "listings" ORDER BY "listings"."id" DESC LIMIT 1
269
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
270
+  (0.2ms) BEGIN
271
+ Listing Load (0.2ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 216]]
272
+ Approvable::ChangeRequest Load (0.3ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 216], ["approvable_type", "Listing"]]
273
+  (0.2ms) ROLLBACK
274
+  (0.1ms) BEGIN
275
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "state" = $2, "updated_at" = $3 WHERE "approvable_change_requests"."id" = 1408 [["requested_changes", "{\"title\":\"hi\",\"description\":\"body\"}"], ["state", "pending"], ["updated_at", "2014-08-08 11:54:00.898357"]]
276
+  (62.2ms) COMMIT
277
+  (0.1ms) BEGIN
278
+  (0.3ms) COMMIT
279
+  (0.2ms) BEGIN
280
+ SQL (0.4ms) UPDATE "approvable_change_requests" SET "requested_changes" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1408 [["requested_changes", "{\"title\":\"hi\",\"description\":\"boddyy\"}"], ["updated_at", "2014-08-08 11:54:20.698919"]]
281
+  (2.5ms) COMMIT
282
+  (0.2ms) BEGIN
283
+ SQL (0.4ms) UPDATE "listings" SET "description" = $1, "title" = $2, "updated_at" = $3 WHERE "listings"."id" = 216 [["description", "boddyy"], ["title", "hi"], ["updated_at", "2014-08-08 11:54:27.987685"]]
284
+  (44.2ms) COMMIT
285
+  (0.3ms) BEGIN
286
+  (0.2ms) ROLLBACK
287
+  (0.2ms) BEGIN
288
+  (0.2ms) ROLLBACK
289
+  (0.2ms) BEGIN
290
+  (0.2ms) ROLLBACK
291
+  (0.3ms) BEGIN
292
+  (0.8ms) SELECT COUNT(*) FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" IS NULL AND ("approvable_change_requests"."state" != 'approved')
293
+ SQL (0.9ms) INSERT INTO "listings" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2014-08-08 12:35:54.454953"], ["updated_at", "2014-08-08 12:35:54.454953"]]
294
+ SQL (0.5ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 1453], ["approvable_type", "Listing"], ["created_at", "2014-08-08 12:35:54.735790"], ["requested_changes", "{\"title\":\"1\"}"], ["state", "pending"], ["updated_at", "2014-08-08 12:35:54.735790"]]
295
+  (88.0ms) COMMIT
296
+  (0.4ms) BEGIN
297
+ SQL (0.7ms) UPDATE "approvable_change_requests" SET "state" = $1, "updated_at" = $2 WHERE "approvable_change_requests"."id" = 1746 [["state", "submitted"], ["updated_at", "2014-08-08 12:38:07.928835"]]
298
+  (2.8ms) COMMIT
299
+ Listing Load (0.6ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 1453]]
300
+ Listing Load (0.8ms) SELECT "listings".* FROM "listings" WHERE "listings"."id" = $1 LIMIT 1 [["id", 1453]]
301
+  (0.2ms) BEGIN
302
+ Approvable::ChangeRequest Load (0.5ms) SELECT "approvable_change_requests".* FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" = $1 AND "approvable_change_requests"."approvable_type" = $2 AND ("approvable_change_requests"."state" != 'approved') LIMIT 1 [["approvable_id", 1453], ["approvable_type", "Listing"]]
303
+  (0.2ms) ROLLBACK
304
+  (0.4ms) BEGIN
305
+  (0.2ms) ROLLBACK
306
+  (0.3ms) BEGIN
307
+  (0.4ms) SELECT COUNT(*) FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" IS NULL AND ("approvable_change_requests"."state" != 'approved')
308
+ SQL (0.4ms) INSERT INTO "listings" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2014-08-08 12:41:01.144582"], ["updated_at", "2014-08-08 12:41:01.144582"]]
309
+ SQL (0.3ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 1478], ["approvable_type", "Listing"], ["created_at", "2014-08-08 12:41:01.146560"], ["requested_changes", "{\"title\":1}"], ["state", "pending"], ["updated_at", "2014-08-08 12:41:01.146560"]]
310
+  (90.9ms) COMMIT
311
+  (0.4ms) BEGIN
312
+  (0.7ms) SELECT COUNT(*) FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" IS NULL AND ("approvable_change_requests"."state" != 'approved')
313
+ SQL (0.5ms) INSERT INTO "listings" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2014-08-08 12:41:47.423388"], ["updated_at", "2014-08-08 12:41:47.423388"]]
314
+ SQL (0.4ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 1503], ["approvable_type", "Listing"], ["created_at", "2014-08-08 12:41:47.425546"], ["requested_changes", "{}"], ["state", "pending"], ["updated_at", "2014-08-08 12:41:47.425546"]]
315
+  (15.9ms) COMMIT
316
+  (0.3ms) BEGIN
317
+  (0.6ms) SELECT COUNT(*) FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_type" = 'Listing' AND "approvable_change_requests"."approvable_id" = 1503 AND ("approvable_change_requests"."state" != 'approved')
318
+  (0.2ms) ROLLBACK
319
+  (0.3ms) BEGIN
320
+  (1.4ms) SELECT COUNT(*) FROM "approvable_change_requests" WHERE "approvable_change_requests"."approvable_id" IS NULL AND ("approvable_change_requests"."state" != 'approved')
321
+ SQL (1.2ms) INSERT INTO "listings" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2014-08-08 13:43:24.948893"], ["updated_at", "2014-08-08 13:43:24.948893"]]
322
+ SQL (0.6ms) INSERT INTO "approvable_change_requests" ("approvable_id", "approvable_type", "created_at", "requested_changes", "state", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["approvable_id", 2136], ["approvable_type", "Listing"], ["created_at", "2014-08-08 13:43:25.002661"], ["requested_changes", "{\"title\":\"1\"}"], ["state", "pending"], ["updated_at", "2014-08-08 13:43:25.002661"]]
323
+  (217.7ms) COMMIT
324
+  (0.1ms) BEGIN
325
+  (0.4ms) COMMIT
326
+  (0.2ms) BEGIN
327
+ SQL (0.5ms) UPDATE "listings" SET "title" = $1, "updated_at" = $2 WHERE "listings"."id" = 2136 [["title", "new"], ["updated_at", "2014-08-08 13:43:40.365853"]]
328
+  (72.1ms) COMMIT
329
+  (0.3ms) BEGIN
330
+  (0.3ms) COMMIT
331
+  (38.2ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
332
+  (2.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
333
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
334
+ Migrating to CreateListings (20140807144654)
335
+  (0.1ms) BEGIN
336
+  (5.4ms) CREATE TABLE "listings" ("id" serial primary key, "title" character varying(255), "description" text, "image" character varying(255), "deleted" boolean, "created_at" timestamp, "updated_at" timestamp) 
337
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140807144654"]]
338
+  (0.5ms) COMMIT
339
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"