poly_belongs_to 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d945fa7f779711426e5f3f4cf5cea436255a2403
4
- data.tar.gz: 2bfbbeec531d122fa8520523b4b9fae25f4e52a3
3
+ metadata.gz: 5e6054c91db73afab22ff9dc7c29f9571abd9879
4
+ data.tar.gz: 15bb717fb64810467be0b60106d447b684155fd8
5
5
  SHA512:
6
- metadata.gz: 49341ba09d46570a56bfce7368927931fe3ab5787a412c1983544f30bcec6b74061f1165f6e3d6641bf783077bd66685de7ef50f9d53e81fed464159bc12deae
7
- data.tar.gz: 710b7e8a888401bdf849969e84e9d7570ae88183f716d0428c02ff9d3574a4b0b7b3a07d9e20122b3e60a89dd0da03e84d751e719b66dbd0eb005bf8daf236bf
6
+ metadata.gz: 44cc12a9ad44ead468cb743f2c667155770e250cdb89ae860ddff6d1d21f6079bacd51ca02f443f3b4907f068ad221745b516a357a0c7c643a03b1ee54c91db4
7
+ data.tar.gz: 0c5106163968c48cf6cc7874bd5d6b5533d48fa00f5fe12afd7b2682e0f8ad3eea70978b97e44b821a3c4ca0421a7942364d540e68917f92a7c89aadcf78f7d8
data/README.md CHANGED
@@ -40,6 +40,18 @@ Tire.pbts
40
40
  MyObject.pbt_orphans
41
41
  # => #<ActiveRecord::Relation []> # nil for objects without belongs_to
42
42
 
43
+ # Get polymorphic objects for records of invalid class type(s)
44
+ MyObject.pbt_mistyped
45
+ # => #<ActiveRecord::Relation []>
46
+
47
+ # Get the invalid class types on polymorphic records as a Array of Strings
48
+ MyObject.pbt_mistypes
49
+ # => ["Object", "Class", "MyObjectable"]
50
+
51
+ # Get the valid class types on polymorphic records as a Array of Strings
52
+ MyObject.pbt_valid_types
53
+ # => ["User", "MyObject"]
54
+
43
55
  # Params name
44
56
  MyObject.pbt_params_name
45
57
  # => :my_objectable_attributes
@@ -75,6 +87,10 @@ MyObject.first.pbt_top_parent
75
87
  # Mutliple Parent Objects (List of one item for Polymorphic, full list otherwise.)
76
88
  Tire.first.pbt_parents
77
89
  # => [#<User id: 123 ... >, #<Car id: 234 ... >]
90
+
91
+ # Determine if object is orphaned (parent no longer exists)
92
+ Tire.first.orphan?
93
+ # => false
78
94
  ```
79
95
 
80
96
  ##Also Available
@@ -49,7 +49,7 @@ module PolyBelongsTo
49
49
  # @return [Array<String>]
50
50
  def self.pbt_poly_types
51
51
  return [] unless poly?
52
- pluck(pbt_type_sym).uniq
52
+ uniq.pluck(pbt_type_sym)
53
53
  end
54
54
 
55
55
  # Returns strings of the invalid class names stored in polymorphic records
@@ -86,12 +86,12 @@ module PolyBelongsTo
86
86
  # Return Array of current Class polymorphic records that are orphaned from parents
87
87
  # @return [Array<Object>] ActiveRecord orphan objects
88
88
  def self._pbt_polymorphic_orphans
89
- accumalitive = nil
89
+ accumulative = nil
90
90
  pbt_valid_types.each do |type|
91
91
  arel_part = arel_table[pbt_id_sym].not_in(type.constantize.pluck(:id)).and(arel_table[pbt_type_sym].eq(type))
92
- accumalitive = accumalitive.present? ? accumalitive.or(arel_part) : arel_part
92
+ accumulative = accumulative.present? ? accumulative.or(arel_part) : arel_part
93
93
  end
94
- where(accumalitive)
94
+ where(accumulative)
95
95
  end
96
96
 
97
97
  # Return Array of current Class nonpolymorphic records that are orphaned from parents
@@ -170,7 +170,7 @@ module PolyBelongsTo
170
170
  Array[pbt_parent].compact
171
171
  else
172
172
  self.class.pbts.map {|i|
173
- try{ "#{i.capitalize}".constantize.find(self.send("#{i}_id")) }
173
+ try{ "#{i.capitalize}".constantize.where(id: self.send("#{i}_id")).first }
174
174
  }.compact
175
175
  end
176
176
  end
@@ -1,4 +1,4 @@
1
1
  module PolyBelongsTo
2
2
  # VERSION follows symantic versioning rules
3
- VERSION = "0.2.6"
3
+ VERSION = "0.2.7"
4
4
  end
data/test/core_test.rb CHANGED
@@ -274,6 +274,34 @@ class CoreTest < ActiveSupport::TestCase
274
274
  Squishy.pbt_valid_types.sort.must_equal ["Phone", "Address", "GeoLocation"].sort
275
275
  end
276
276
 
277
+ it "#pbt_valid_types returns empty Array for no valid record types" do
278
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Object")
279
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Class")
280
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Squishable")
281
+ Coffee.pbt_valid_types.to_a.sort.must_be :empty?
282
+ end
283
+
284
+ it "I'm just curious if polymorphic can belong to itself" do
285
+ coffee = Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Coffee")
286
+ coffee.must_be :valid?
287
+ coffee.coffeeable_type.must_equal "Coffee"
288
+ coffee.must_be :persisted?
289
+ end
290
+
291
+ it "#pbt_mistyped returns empty Array for no valid record types" do
292
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Phone")
293
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "Address")
294
+ Coffee.create(Coffee.pbt_id_sym => 12345, Coffee.pbt_type_sym => "User")
295
+ Coffee.pbt_mistyped.to_a.sort.must_be :empty?
296
+ end
297
+
298
+ it "#pbt_mistypes returns empty Array if only valid polymorphic record types exist" do
299
+ Squishy.create(Squishy.pbt_id_sym => 12345, Squishy.pbt_type_sym => "Phone")
300
+ Squishy.create(Squishy.pbt_id_sym => 12345, Squishy.pbt_type_sym => "Address")
301
+ Squishy.create(Squishy.pbt_id_sym => 12345, Squishy.pbt_type_sym => "GeoLocation")
302
+ Squishy.pbt_mistypes.sort.must_be :empty?
303
+ end
304
+
277
305
  it "#pbt_poly_types returns strings of all polymorphic record types" do
278
306
  Squishy.create(Squishy.pbt_id_sym => 12345, Squishy.pbt_type_sym => "Object")
279
307
  Squishy.create(Squishy.pbt_id_sym => 12345, Squishy.pbt_type_sym => "Class")
@@ -0,0 +1,4 @@
1
+ class Coffee < ActiveRecord::Base
2
+ belongs_to :coffeeable, polymorphic: true
3
+ has_many :coffees, as: :coffeeable, dependent: :destroy
4
+ end
@@ -0,0 +1,9 @@
1
+ class CreateCoffees < ActiveRecord::Migration
2
+ def change
3
+ create_table :coffees do |t|
4
+ t.references :coffeeable, polymorphic: true, index: true
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -11,9 +11,9 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150322233755) do
14
+ ActiveRecord::Schema.define(version: 20150511161648) do
15
15
 
16
- create_table "addresses", force: true do |t|
16
+ create_table "addresses", force: :cascade do |t|
17
17
  t.integer "addressable_id"
18
18
  t.string "addressable_type"
19
19
  t.string "content"
@@ -21,9 +21,9 @@ ActiveRecord::Schema.define(version: 20150322233755) do
21
21
  t.datetime "updated_at"
22
22
  end
23
23
 
24
- add_index "addresses", ["addressable_id", "addressable_type"], name: "index_addresses_on_addressable_id_and_addressable_type"
24
+ add_index "addresses", ["addressable_type", "addressable_id"], name: "index_addresses_on_addressable_type_and_addressable_id"
25
25
 
26
- create_table "alphas", force: true do |t|
26
+ create_table "alphas", force: :cascade do |t|
27
27
  t.string "content"
28
28
  t.integer "delta_id"
29
29
  t.datetime "created_at"
@@ -32,7 +32,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
32
32
 
33
33
  add_index "alphas", ["delta_id"], name: "index_alphas_on_delta_id"
34
34
 
35
- create_table "beta", force: true do |t|
35
+ create_table "beta", force: :cascade do |t|
36
36
  t.string "content"
37
37
  t.integer "alpha_id"
38
38
  t.datetime "created_at"
@@ -41,7 +41,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
41
41
 
42
42
  add_index "beta", ["alpha_id"], name: "index_beta_on_alpha_id"
43
43
 
44
- create_table "capas", force: true do |t|
44
+ create_table "capas", force: :cascade do |t|
45
45
  t.string "content"
46
46
  t.integer "beta_id"
47
47
  t.datetime "created_at"
@@ -50,7 +50,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
50
50
 
51
51
  add_index "capas", ["beta_id"], name: "index_capas_on_beta_id"
52
52
 
53
- create_table "cars", force: true do |t|
53
+ create_table "cars", force: :cascade do |t|
54
54
  t.integer "user_id"
55
55
  t.string "content"
56
56
  t.datetime "created_at"
@@ -59,7 +59,16 @@ ActiveRecord::Schema.define(version: 20150322233755) do
59
59
 
60
60
  add_index "cars", ["user_id"], name: "index_cars_on_user_id"
61
61
 
62
- create_table "contacts", force: true do |t|
62
+ create_table "coffees", force: :cascade do |t|
63
+ t.integer "coffeeable_id"
64
+ t.string "coffeeable_type"
65
+ t.datetime "created_at", null: false
66
+ t.datetime "updated_at", null: false
67
+ end
68
+
69
+ add_index "coffees", ["coffeeable_type", "coffeeable_id"], name: "index_coffees_on_coffeeable_type_and_coffeeable_id"
70
+
71
+ create_table "contacts", force: :cascade do |t|
63
72
  t.integer "user_id"
64
73
  t.string "content"
65
74
  t.datetime "created_at"
@@ -68,7 +77,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
68
77
 
69
78
  add_index "contacts", ["user_id"], name: "index_contacts_on_user_id"
70
79
 
71
- create_table "delta", force: true do |t|
80
+ create_table "delta", force: :cascade do |t|
72
81
  t.string "content"
73
82
  t.integer "capa_id"
74
83
  t.datetime "created_at"
@@ -77,7 +86,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
77
86
 
78
87
  add_index "delta", ["capa_id"], name: "index_delta_on_capa_id"
79
88
 
80
- create_table "geo_locations", force: true do |t|
89
+ create_table "geo_locations", force: :cascade do |t|
81
90
  t.integer "address_id"
82
91
  t.string "content"
83
92
  t.datetime "created_at"
@@ -86,7 +95,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
86
95
 
87
96
  add_index "geo_locations", ["address_id"], name: "index_geo_locations_on_address_id"
88
97
 
89
- create_table "phones", force: true do |t|
98
+ create_table "phones", force: :cascade do |t|
90
99
  t.integer "phoneable_id"
91
100
  t.string "phoneable_type"
92
101
  t.string "content"
@@ -94,9 +103,9 @@ ActiveRecord::Schema.define(version: 20150322233755) do
94
103
  t.datetime "updated_at", null: false
95
104
  end
96
105
 
97
- add_index "phones", ["phoneable_id", "phoneable_type"], name: "index_phones_on_phoneable_id_and_phoneable_type"
106
+ add_index "phones", ["phoneable_type", "phoneable_id"], name: "index_phones_on_phoneable_type_and_phoneable_id"
98
107
 
99
- create_table "photos", force: true do |t|
108
+ create_table "photos", force: :cascade do |t|
100
109
  t.integer "photoable_id"
101
110
  t.string "photoable_type"
102
111
  t.string "content"
@@ -104,9 +113,9 @@ ActiveRecord::Schema.define(version: 20150322233755) do
104
113
  t.datetime "updated_at"
105
114
  end
106
115
 
107
- add_index "photos", ["photoable_id", "photoable_type"], name: "index_photos_on_photoable_id_and_photoable_type"
116
+ add_index "photos", ["photoable_type", "photoable_id"], name: "index_photos_on_photoable_type_and_photoable_id"
108
117
 
109
- create_table "profiles", force: true do |t|
118
+ create_table "profiles", force: :cascade do |t|
110
119
  t.integer "profileable_id"
111
120
  t.string "profileable_type"
112
121
  t.string "content"
@@ -114,9 +123,9 @@ ActiveRecord::Schema.define(version: 20150322233755) do
114
123
  t.datetime "updated_at"
115
124
  end
116
125
 
117
- add_index "profiles", ["profileable_id", "profileable_type"], name: "index_profiles_on_profileable_id_and_profileable_type"
126
+ add_index "profiles", ["profileable_type", "profileable_id"], name: "index_profiles_on_profileable_type_and_profileable_id"
118
127
 
119
- create_table "squishies", force: true do |t|
128
+ create_table "squishies", force: :cascade do |t|
120
129
  t.string "content"
121
130
  t.integer "squishable_id"
122
131
  t.string "squishable_type"
@@ -124,9 +133,9 @@ ActiveRecord::Schema.define(version: 20150322233755) do
124
133
  t.datetime "updated_at"
125
134
  end
126
135
 
127
- add_index "squishies", ["squishable_id", "squishable_type"], name: "index_squishies_on_squishable_id_and_squishable_type"
136
+ add_index "squishies", ["squishable_type", "squishable_id"], name: "index_squishies_on_squishable_type_and_squishable_id"
128
137
 
129
- create_table "ssns", force: true do |t|
138
+ create_table "ssns", force: :cascade do |t|
130
139
  t.integer "user_id"
131
140
  t.string "content"
132
141
  t.datetime "created_at"
@@ -135,7 +144,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
135
144
 
136
145
  add_index "ssns", ["user_id"], name: "index_ssns_on_user_id"
137
146
 
138
- create_table "tags", force: true do |t|
147
+ create_table "tags", force: :cascade do |t|
139
148
  t.integer "user_id"
140
149
  t.string "content"
141
150
  t.datetime "created_at", null: false
@@ -144,7 +153,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
144
153
 
145
154
  add_index "tags", ["user_id"], name: "index_tags_on_user_id"
146
155
 
147
- create_table "tires", force: true do |t|
156
+ create_table "tires", force: :cascade do |t|
148
157
  t.integer "user_id"
149
158
  t.integer "car_id"
150
159
  t.string "content"
@@ -155,7 +164,7 @@ ActiveRecord::Schema.define(version: 20150322233755) do
155
164
  add_index "tires", ["car_id"], name: "index_tires_on_car_id"
156
165
  add_index "tires", ["user_id"], name: "index_tires_on_user_id"
157
166
 
158
- create_table "users", force: true do |t|
167
+ create_table "users", force: :cascade do |t|
159
168
  t.string "content"
160
169
  t.datetime "created_at", null: false
161
170
  t.datetime "updated_at", null: false
Binary file
@@ -314,3 +314,267 @@ Migrating to CreateDelta (20150322233755)
314
314
  SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233755"]]
315
315
   (12.5ms) commit transaction
316
316
  ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
317
+  (15.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
318
+  (0.2ms) select sqlite_version(*)
319
+  (12.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
320
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
321
+ Migrating to CreateUsers (20150211224139)
322
+  (0.1ms) begin transaction
323
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
324
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224139"]]
325
+  (17.2ms) commit transaction
326
+ Migrating to CreateTags (20150211224157)
327
+  (0.1ms) begin transaction
328
+  (0.6ms) CREATE TABLE "tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
329
+  (0.3ms) CREATE INDEX "index_tags_on_user_id" ON "tags" ("user_id")
330
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224157"]]
331
+  (22.8ms) commit transaction
332
+ Migrating to CreatePhones (20150211224225)
333
+  (0.1ms) begin transaction
334
+  (0.6ms) CREATE TABLE "phones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "phoneable_id" integer, "phoneable_type" varchar, "content" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
335
+  (0.3ms) CREATE INDEX "index_phones_on_phoneable_type_and_phoneable_id" ON "phones" ("phoneable_type", "phoneable_id")
336
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150211224225"]]
337
+  (24.6ms) commit transaction
338
+ Migrating to CreateAddresses (20150216092218)
339
+  (0.1ms) begin transaction
340
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150216092218_create_addresses.rb:7)
341
+  (0.6ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_id" integer, "addressable_type" varchar, "content" varchar, "created_at" datetime, "updated_at" datetime)
342
+  (0.3ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
343
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092218"]]
344
+  (25.0ms) commit transaction
345
+ Migrating to CreateProfiles (20150216092338)
346
+  (0.1ms) begin transaction
347
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150216092338_create_profiles.rb:7)
348
+  (0.7ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "profileable_id" integer, "profileable_type" varchar, "content" varchar, "created_at" datetime, "updated_at" datetime) 
349
+  (0.3ms) CREATE INDEX "index_profiles_on_profileable_type_and_profileable_id" ON "profiles" ("profileable_type", "profileable_id")
350
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092338"]]
351
+  (27.6ms) commit transaction
352
+ Migrating to CreatePhotos (20150216092411)
353
+  (0.1ms) begin transaction
354
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150216092411_create_photos.rb:7)
355
+  (0.6ms) CREATE TABLE "photos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "photoable_id" integer, "photoable_type" varchar, "content" varchar, "created_at" datetime, "updated_at" datetime)
356
+  (0.5ms) CREATE INDEX "index_photos_on_photoable_type_and_photoable_id" ON "photos" ("photoable_type", "photoable_id")
357
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092411"]]
358
+  (28.3ms) commit transaction
359
+ Migrating to CreateContacts (20150216092449)
360
+  (0.1ms) begin transaction
361
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150216092449_create_contacts.rb:7)
362
+  (0.6ms) CREATE TABLE "contacts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar, "created_at" datetime, "updated_at" datetime) 
363
+  (0.3ms) CREATE INDEX "index_contacts_on_user_id" ON "contacts" ("user_id")
364
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092449"]]
365
+  (31.5ms) commit transaction
366
+ Migrating to CreateSsns (20150216092519)
367
+  (0.1ms) begin transaction
368
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150216092519_create_ssns.rb:7)
369
+  (0.6ms) CREATE TABLE "ssns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar, "created_at" datetime, "updated_at" datetime)
370
+  (0.3ms) CREATE INDEX "index_ssns_on_user_id" ON "ssns" ("user_id")
371
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150216092519"]]
372
+  (27.7ms) commit transaction
373
+ Migrating to CreateGeoLocations (20150220213422)
374
+  (0.1ms) begin transaction
375
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150220213422_create_geo_locations.rb:7)
376
+  (0.6ms) CREATE TABLE "geo_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address_id" integer, "content" varchar, "created_at" datetime, "updated_at" datetime) 
377
+  (0.4ms) CREATE INDEX "index_geo_locations_on_address_id" ON "geo_locations" ("address_id")
378
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220213422"]]
379
+  (29.9ms) commit transaction
380
+ Migrating to CreateSquishies (20150220230146)
381
+  (0.2ms) begin transaction
382
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150220230146_create_squishies.rb:7)
383
+  (0.7ms) CREATE TABLE "squishies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "squishable_id" integer, "squishable_type" varchar, "created_at" datetime, "updated_at" datetime)
384
+  (0.5ms) CREATE INDEX "index_squishies_on_squishable_type_and_squishable_id" ON "squishies" ("squishable_type", "squishable_id")
385
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150220230146"]]
386
+  (26.3ms) commit transaction
387
+ Migrating to CreateTires (20150301100658)
388
+  (0.2ms) begin transaction
389
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150301100658_create_tires.rb:8)
390
+  (0.7ms) CREATE TABLE "tires" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "car_id" integer, "content" varchar, "created_at" datetime, "updated_at" datetime) 
391
+  (0.3ms) CREATE INDEX "index_tires_on_user_id" ON "tires" ("user_id")
392
+  (0.2ms)  SELECT sql
393
+ FROM sqlite_master
394
+ WHERE name='index_tires_on_user_id' AND type='index'
395
+ UNION ALL
396
+ SELECT sql
397
+ FROM sqlite_temp_master
398
+ WHERE name='index_tires_on_user_id' AND type='index'
399
+ 
400
+  (0.3ms) CREATE INDEX "index_tires_on_car_id" ON "tires" ("car_id")
401
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150301100658"]]
402
+  (22.0ms) commit transaction
403
+ Migrating to CreateCars (20150301100722)
404
+  (0.1ms) begin transaction
405
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150301100722_create_cars.rb:7)
406
+  (0.3ms) CREATE TABLE "cars" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "content" varchar, "created_at" datetime, "updated_at" datetime)
407
+  (0.2ms) CREATE INDEX "index_cars_on_user_id" ON "cars" ("user_id")
408
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150301100722"]]
409
+  (26.1ms) commit transaction
410
+ Migrating to CreateAlphas (20150322233720)
411
+  (0.1ms) begin transaction
412
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150322233720_create_alphas.rb:7)
413
+  (0.7ms) CREATE TABLE "alphas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "delta_id" integer, "created_at" datetime, "updated_at" datetime) 
414
+  (0.4ms) CREATE INDEX "index_alphas_on_delta_id" ON "alphas" ("delta_id")
415
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233720"]]
416
+  (31.0ms) commit transaction
417
+ Migrating to CreateBeta (20150322233733)
418
+  (0.1ms) begin transaction
419
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150322233733_create_beta.rb:7)
420
+  (0.5ms) CREATE TABLE "beta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "alpha_id" integer, "created_at" datetime, "updated_at" datetime)
421
+  (0.3ms) CREATE INDEX "index_beta_on_alpha_id" ON "beta" ("alpha_id")
422
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233733"]]
423
+  (27.2ms) commit transaction
424
+ Migrating to CreateCapas (20150322233743)
425
+  (0.1ms) begin transaction
426
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150322233743_create_capas.rb:7)
427
+  (0.7ms) CREATE TABLE "capas" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "beta_id" integer, "created_at" datetime, "updated_at" datetime) 
428
+  (0.5ms) CREATE INDEX "index_capas_on_beta_id" ON "capas" ("beta_id")
429
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233743"]]
430
+  (26.4ms) commit transaction
431
+ Migrating to CreateDelta (20150322233755)
432
+  (0.1ms) begin transaction
433
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /home/danielpclark/dev/PolyBelongsTo/test/dummy/db/migrate/20150322233755_create_delta.rb:7)
434
+  (0.7ms) CREATE TABLE "delta" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" varchar, "capa_id" integer, "created_at" datetime, "updated_at" datetime)
435
+  (0.3ms) CREATE INDEX "index_delta_on_capa_id" ON "delta" ("capa_id")
436
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150322233755"]]
437
+  (26.0ms) commit transaction
438
+ Migrating to CreateCoffees (20150511161648)
439
+  (0.1ms) begin transaction
440
+  (0.7ms) CREATE TABLE "coffees" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "coffeeable_id" integer, "coffeeable_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
441
+  (0.3ms) CREATE INDEX "index_coffees_on_coffeeable_type_and_coffeeable_id" ON "coffees" ("coffeeable_type", "coffeeable_id")
442
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150511161648"]]
443
+  (22.4ms) commit transaction
444
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
445
+  (0.3ms) SELECT sql
446
+ FROM sqlite_master
447
+ WHERE name='index_addresses_on_addressable_type_and_addressable_id' AND type='index'
448
+ UNION ALL
449
+ SELECT sql
450
+ FROM sqlite_temp_master
451
+ WHERE name='index_addresses_on_addressable_type_and_addressable_id' AND type='index'
452
+
453
+  (0.1ms)  SELECT sql
454
+ FROM sqlite_master
455
+ WHERE name='index_alphas_on_delta_id' AND type='index'
456
+ UNION ALL
457
+ SELECT sql
458
+ FROM sqlite_temp_master
459
+ WHERE name='index_alphas_on_delta_id' AND type='index'
460
+ 
461
+  (0.1ms) SELECT sql
462
+ FROM sqlite_master
463
+ WHERE name='index_beta_on_alpha_id' AND type='index'
464
+ UNION ALL
465
+ SELECT sql
466
+ FROM sqlite_temp_master
467
+ WHERE name='index_beta_on_alpha_id' AND type='index'
468
+
469
+  (0.1ms)  SELECT sql
470
+ FROM sqlite_master
471
+ WHERE name='index_capas_on_beta_id' AND type='index'
472
+ UNION ALL
473
+ SELECT sql
474
+ FROM sqlite_temp_master
475
+ WHERE name='index_capas_on_beta_id' AND type='index'
476
+ 
477
+  (0.1ms) SELECT sql
478
+ FROM sqlite_master
479
+ WHERE name='index_cars_on_user_id' AND type='index'
480
+ UNION ALL
481
+ SELECT sql
482
+ FROM sqlite_temp_master
483
+ WHERE name='index_cars_on_user_id' AND type='index'
484
+
485
+  (0.1ms)  SELECT sql
486
+ FROM sqlite_master
487
+ WHERE name='index_coffees_on_coffeeable_type_and_coffeeable_id' AND type='index'
488
+ UNION ALL
489
+ SELECT sql
490
+ FROM sqlite_temp_master
491
+ WHERE name='index_coffees_on_coffeeable_type_and_coffeeable_id' AND type='index'
492
+ 
493
+  (0.1ms) SELECT sql
494
+ FROM sqlite_master
495
+ WHERE name='index_contacts_on_user_id' AND type='index'
496
+ UNION ALL
497
+ SELECT sql
498
+ FROM sqlite_temp_master
499
+ WHERE name='index_contacts_on_user_id' AND type='index'
500
+
501
+  (0.1ms)  SELECT sql
502
+ FROM sqlite_master
503
+ WHERE name='index_delta_on_capa_id' AND type='index'
504
+ UNION ALL
505
+ SELECT sql
506
+ FROM sqlite_temp_master
507
+ WHERE name='index_delta_on_capa_id' AND type='index'
508
+ 
509
+  (0.1ms) SELECT sql
510
+ FROM sqlite_master
511
+ WHERE name='index_geo_locations_on_address_id' AND type='index'
512
+ UNION ALL
513
+ SELECT sql
514
+ FROM sqlite_temp_master
515
+ WHERE name='index_geo_locations_on_address_id' AND type='index'
516
+
517
+  (0.1ms)  SELECT sql
518
+ FROM sqlite_master
519
+ WHERE name='index_phones_on_phoneable_type_and_phoneable_id' AND type='index'
520
+ UNION ALL
521
+ SELECT sql
522
+ FROM sqlite_temp_master
523
+ WHERE name='index_phones_on_phoneable_type_and_phoneable_id' AND type='index'
524
+ 
525
+  (0.1ms) SELECT sql
526
+ FROM sqlite_master
527
+ WHERE name='index_photos_on_photoable_type_and_photoable_id' AND type='index'
528
+ UNION ALL
529
+ SELECT sql
530
+ FROM sqlite_temp_master
531
+ WHERE name='index_photos_on_photoable_type_and_photoable_id' AND type='index'
532
+
533
+  (0.1ms)  SELECT sql
534
+ FROM sqlite_master
535
+ WHERE name='index_profiles_on_profileable_type_and_profileable_id' AND type='index'
536
+ UNION ALL
537
+ SELECT sql
538
+ FROM sqlite_temp_master
539
+ WHERE name='index_profiles_on_profileable_type_and_profileable_id' AND type='index'
540
+ 
541
+  (0.1ms) SELECT sql
542
+ FROM sqlite_master
543
+ WHERE name='index_squishies_on_squishable_type_and_squishable_id' AND type='index'
544
+ UNION ALL
545
+ SELECT sql
546
+ FROM sqlite_temp_master
547
+ WHERE name='index_squishies_on_squishable_type_and_squishable_id' AND type='index'
548
+
549
+  (0.1ms)  SELECT sql
550
+ FROM sqlite_master
551
+ WHERE name='index_ssns_on_user_id' AND type='index'
552
+ UNION ALL
553
+ SELECT sql
554
+ FROM sqlite_temp_master
555
+ WHERE name='index_ssns_on_user_id' AND type='index'
556
+ 
557
+  (0.1ms) SELECT sql
558
+ FROM sqlite_master
559
+ WHERE name='index_tags_on_user_id' AND type='index'
560
+ UNION ALL
561
+ SELECT sql
562
+ FROM sqlite_temp_master
563
+ WHERE name='index_tags_on_user_id' AND type='index'
564
+
565
+  (0.1ms)  SELECT sql
566
+ FROM sqlite_master
567
+ WHERE name='index_tires_on_car_id' AND type='index'
568
+ UNION ALL
569
+ SELECT sql
570
+ FROM sqlite_temp_master
571
+ WHERE name='index_tires_on_car_id' AND type='index'
572
+ 
573
+  (0.1ms) SELECT sql
574
+ FROM sqlite_master
575
+ WHERE name='index_tires_on_user_id' AND type='index'
576
+ UNION ALL
577
+ SELECT sql
578
+ FROM sqlite_temp_master
579
+ WHERE name='index_tires_on_user_id' AND type='index'
580
+