slugs 4.0.0.2 → 4.0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b2173a8e348703fda0103766323af8fd1757436
4
- data.tar.gz: 47d0a06f3a94ce40e66bc6d24819a8c7410ef8c4
3
+ metadata.gz: 4740d4cba888010bd06b6aa8401b04d76f4c7a2e
4
+ data.tar.gz: eeec56ac69741a763d559624e977e3eb9de139ae
5
5
  SHA512:
6
- metadata.gz: 4c415a66b055841ba100b43409b920abc6795c94b77c9f6ff478a47fda9289f0989e86b34f5c217bebfecd6716f955ec3ad7bd276f236b2de4cb2c4610b6b6b3
7
- data.tar.gz: cf2df8fbdda3f6f715180aa54d4691c32f8013312aea94788748323c9737325b5d8dc1124c6a78cdc7c9a571b31906dfcc619e769579e175b6b212ac60e16a61
6
+ metadata.gz: 3e6f3463710e728c614debd945951e5ec97ccb57836f84408279fc60031c23bc6ed460497ee676c36578de53ec9abe351e4f78edac7a7b9d9ed3274e624c8deb
7
+ data.tar.gz: 296c469abf2463094106a78bc93a871abd8a7324f8f3f8c0cfd022e4658a3146f7de44781aae911415d046c925a7a15a5879c424fe9a2893370ad558621afd3c
data/README.md CHANGED
@@ -80,37 +80,52 @@ $ bundle exec rake slugs:migrate
80
80
  A slug will be generated every time you create/update a record:
81
81
  ```ruby
82
82
  product = Product.create(name: 'Stratocaster', model: 'American Standar', ...)
83
- product.slug # => 'american-standard-stratocaster'
83
+ product.slug
84
+ # => 'american-standard-stratocaster'
84
85
  ```
85
86
 
86
87
  An index will be appended if another record with the same slug is created:
87
88
  ```ruby
88
89
  product = Product.create(name: 'Stratocaster', model: 'American Standard', ...)
89
- product.slug # => 'american-standard-stratocaster-1'
90
+ product.slug
91
+ # => 'american-standard-stratocaster-1'
90
92
  ```
91
93
 
92
94
  Every time you change a record, the slug will be updated:
93
95
  ```ruby
94
96
  product.update name: 'Strat'
95
- product.slug # => 'american-standard-strat'
97
+ product.slug
98
+ # => 'american-standard-strat'
96
99
  ```
97
100
 
98
101
  ### Finders
99
102
 
100
103
  The find method of models will start accepting slugs and remember old ones:
101
104
  ```ruby
102
- Product.find 'american-standard-stratocaster' # => product
103
- Product.find 'american-standard-strat' # => product
105
+ Product.find 'american-standard-stratocaster'
106
+ # => product
107
+
108
+ Product.find 'american-standard-strat'
109
+ # => product
104
110
  ```
105
111
 
106
112
  ### Routes
107
113
 
108
114
  The logic of the use_slug? block is used to determine when to sluggize:
109
115
  ```ruby
110
- admin_product_path product # => 'admin/products/34443'
111
- product_path product # => 'products/american-standard-strat'
116
+ admin_product_path product
117
+ # => 'admin/products/34443'
118
+
119
+ product_path product
120
+ # => 'products/american-standard-strat'
112
121
  ```
113
122
 
123
+ ## Contributing
124
+
125
+ Any issue, pull request, comment of any kind is more than welcome!
126
+
127
+ I will mainly ensure compatibility to PostgreSQL, AWS, Redis, Elasticsearch, FreeBSD and Memcached. 
128
+
114
129
  ## Credits
115
130
 
116
131
  This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).
@@ -2,7 +2,7 @@ require 'rails/generators'
2
2
 
3
3
  module Slugs
4
4
  module Generators
5
- class InstallGenerator < ::Rails::Generators::Base
5
+ class InstallGenerator < Rails::Generators::Base
6
6
  include Rails::Generators::Migration
7
7
 
8
8
  source_root File.expand_path('../templates', __FILE__)
@@ -1,22 +1,27 @@
1
1
  module Slugs
2
2
  class Railtie < Rails::Railtie
3
3
 
4
- initializer 'slugs.extensions' do
4
+ initializer 'slugs.action_dispatch' do
5
5
  ::ActionDispatch::Routing::RouteSet::Generator.prepend(
6
6
  Slugs::Extensions::ActionDispatch::Generator
7
7
  )
8
8
  ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper.prepend(
9
9
  Slugs::Extensions::ActionDispatch::OptimizedUrlHelper
10
10
  )
11
- ::ActiveRecord::Base.include(
12
- Slugs::Extensions::ActiveRecord::Base
13
- )
14
- ::ActiveRecord::Base.extend(
15
- Slugs::Extensions::ActiveRecord::Finders
16
- )
17
- ::ActiveRecord::Relation.include(
18
- Slugs::Extensions::ActiveRecord::Finders
19
- )
11
+ end
12
+
13
+ initializer 'slugs.active_record' do
14
+ ActiveSupport.on_load :active_record do
15
+ ::ActiveRecord::Base.include(
16
+ Slugs::Extensions::ActiveRecord::Base
17
+ )
18
+ ::ActiveRecord::Base.extend(
19
+ Slugs::Extensions::ActiveRecord::Finders
20
+ )
21
+ ::ActiveRecord::Relation.include(
22
+ Slugs::Extensions::ActiveRecord::Finders
23
+ )
24
+ end
20
25
  end
21
26
 
22
27
  rake_tasks do
@@ -1,5 +1,5 @@
1
1
  module Slugs
2
2
 
3
- VERSION = '4.0.0.2'
3
+ VERSION = '4.0.0.3'
4
4
 
5
5
  end
@@ -1,7 +1,10 @@
1
- development:
1
+ default: &default
2
2
  adapter: postgresql
3
+
4
+ development:
5
+ <<: *default
3
6
  database: slugs_development
4
7
 
5
8
  test:
6
- adapter: postgresql
9
+ <<: *default
7
10
  database: slugs_test
@@ -614,4 +614,113 @@ WHERE c.contype = 'f'
614
614
  AND t1.relname = 'users'
615
615
  AND t3.nspname = ANY (current_schemas(false))
616
616
  ORDER BY c.conname
617
+ 
618
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
619
+  (22.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
620
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
621
+ Migrating to CreateUsers (20161016174020)
622
+  (0.1ms) BEGIN
623
+  (19.5ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
624
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
625
+  (0.6ms) COMMIT
626
+ Migrating to CreateShops (20161016174126)
627
+  (5.8ms) BEGIN
628
+  (18.8ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
629
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
630
+  (0.6ms) COMMIT
631
+ Migrating to CreateProducts (20161016174202)
632
+  (6.1ms) BEGIN
633
+  (18.7ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
634
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
635
+  (0.4ms) COMMIT
636
+ Migrating to CreateCategories (20161016174225)
637
+  (6.0ms) BEGIN
638
+  (18.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
639
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
640
+  (0.5ms) COMMIT
641
+ Migrating to CreateSlugs (20161124162802)
642
+  (5.5ms) BEGIN
643
+  (19.1ms) CREATE TABLE "slugs" ("id" serial primary key, "sluggable_id" integer, "sluggable_type" character varying, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
644
+  (0.7ms) CREATE INDEX "index_slugs_on_sluggable_id" ON "slugs" ("sluggable_id")
645
+  (0.7ms) CREATE INDEX "index_slugs_on_sluggable_type" ON "slugs" ("sluggable_type")
646
+  (0.6ms) CREATE INDEX "index_slugs_on_value" ON "slugs" ("value")
647
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161124162802"]]
648
+  (0.3ms) COMMIT
649
+ Migrating to CreateDomains (20161208062832)
650
+  (11.7ms) BEGIN
651
+  (7.4ms) CREATE TABLE "domains" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
652
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161208062832"]]
653
+  (4.5ms) COMMIT
654
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
655
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
656
+ FROM pg_constraint c
657
+ JOIN pg_class t1 ON c.conrelid = t1.oid
658
+ JOIN pg_class t2 ON c.confrelid = t2.oid
659
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
660
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
661
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
662
+ WHERE c.contype = 'f'
663
+ AND t1.relname = 'categories'
664
+ AND t3.nspname = ANY (current_schemas(false))
665
+ ORDER BY c.conname
666
+
667
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
668
+ FROM pg_constraint c
669
+ JOIN pg_class t1 ON c.conrelid = t1.oid
670
+ JOIN pg_class t2 ON c.confrelid = t2.oid
671
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
672
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
673
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
674
+ WHERE c.contype = 'f'
675
+ AND t1.relname = 'domains'
676
+ AND t3.nspname = ANY (current_schemas(false))
677
+ ORDER BY c.conname
678
+ 
679
+  (1.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
680
+ FROM pg_constraint c
681
+ JOIN pg_class t1 ON c.conrelid = t1.oid
682
+ JOIN pg_class t2 ON c.confrelid = t2.oid
683
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
684
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
685
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
686
+ WHERE c.contype = 'f'
687
+ AND t1.relname = 'products'
688
+ AND t3.nspname = ANY (current_schemas(false))
689
+ ORDER BY c.conname
690
+
691
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
692
+ FROM pg_constraint c
693
+ JOIN pg_class t1 ON c.conrelid = t1.oid
694
+ JOIN pg_class t2 ON c.confrelid = t2.oid
695
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
696
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
697
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
698
+ WHERE c.contype = 'f'
699
+ AND t1.relname = 'shops'
700
+ AND t3.nspname = ANY (current_schemas(false))
701
+ ORDER BY c.conname
702
+ 
703
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
704
+ FROM pg_constraint c
705
+ JOIN pg_class t1 ON c.conrelid = t1.oid
706
+ JOIN pg_class t2 ON c.confrelid = t2.oid
707
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
708
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
709
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
710
+ WHERE c.contype = 'f'
711
+ AND t1.relname = 'slugs'
712
+ AND t3.nspname = ANY (current_schemas(false))
713
+ ORDER BY c.conname
714
+
715
+  (1.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
716
+ FROM pg_constraint c
717
+ JOIN pg_class t1 ON c.conrelid = t1.oid
718
+ JOIN pg_class t2 ON c.confrelid = t2.oid
719
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
720
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
721
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
722
+ WHERE c.contype = 'f'
723
+ AND t1.relname = 'users'
724
+ AND t3.nspname = ANY (current_schemas(false))
725
+ ORDER BY c.conname
617
726
  
@@ -5589,3 +5589,282 @@ RecordTest: test_indices
5589
5589
  SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul-2"], ["sluggable_type", "Product"], ["sluggable_id", 90], ["created_at", "2016-12-08 20:53:06.278732"], ["updated_at", "2016-12-08 20:53:06.278732"]]
5590
5590
   (0.2ms) RELEASE SAVEPOINT active_record_1
5591
5591
   (0.1ms) ROLLBACK
5592
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
5593
+  (12.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5594
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
5595
+ Migrating to CreateUsers (20161016174020)
5596
+  (0.1ms) BEGIN
5597
+  (7.5ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5598
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
5599
+  (0.6ms) COMMIT
5600
+ Migrating to CreateShops (20161016174126)
5601
+  (0.2ms) BEGIN
5602
+  (2.0ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5603
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
5604
+  (0.5ms) COMMIT
5605
+ Migrating to CreateProducts (20161016174202)
5606
+  (0.2ms) BEGIN
5607
+  (2.0ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5608
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
5609
+  (0.4ms) COMMIT
5610
+ Migrating to CreateCategories (20161016174225)
5611
+  (0.2ms) BEGIN
5612
+  (2.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5613
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
5614
+  (0.4ms) COMMIT
5615
+ Migrating to CreateSlugs (20161124162802)
5616
+  (0.1ms) BEGIN
5617
+  (1.9ms) CREATE TABLE "slugs" ("id" serial primary key, "sluggable_id" integer, "sluggable_type" character varying, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5618
+  (0.6ms) CREATE INDEX "index_slugs_on_sluggable_id" ON "slugs" ("sluggable_id")
5619
+  (0.9ms) CREATE INDEX "index_slugs_on_sluggable_type" ON "slugs" ("sluggable_type")
5620
+  (0.7ms) CREATE INDEX "index_slugs_on_value" ON "slugs" ("value")
5621
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161124162802"]]
5622
+  (0.3ms) COMMIT
5623
+ Migrating to CreateDomains (20161208062832)
5624
+  (0.2ms) BEGIN
5625
+  (2.8ms) CREATE TABLE "domains" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
5626
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161208062832"]]
5627
+  (0.3ms) COMMIT
5628
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5629
+  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5630
+ FROM pg_constraint c
5631
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5632
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5633
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5634
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5635
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5636
+ WHERE c.contype = 'f'
5637
+ AND t1.relname = 'categories'
5638
+ AND t3.nspname = ANY (current_schemas(false))
5639
+ ORDER BY c.conname
5640
+
5641
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5642
+ FROM pg_constraint c
5643
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5644
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5645
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5646
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5647
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5648
+ WHERE c.contype = 'f'
5649
+ AND t1.relname = 'domains'
5650
+ AND t3.nspname = ANY (current_schemas(false))
5651
+ ORDER BY c.conname
5652
+ 
5653
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5654
+ FROM pg_constraint c
5655
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5656
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5657
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5658
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5659
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5660
+ WHERE c.contype = 'f'
5661
+ AND t1.relname = 'products'
5662
+ AND t3.nspname = ANY (current_schemas(false))
5663
+ ORDER BY c.conname
5664
+
5665
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5666
+ FROM pg_constraint c
5667
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5668
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5669
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5670
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5671
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5672
+ WHERE c.contype = 'f'
5673
+ AND t1.relname = 'shops'
5674
+ AND t3.nspname = ANY (current_schemas(false))
5675
+ ORDER BY c.conname
5676
+ 
5677
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5678
+ FROM pg_constraint c
5679
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5680
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5681
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5682
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5683
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5684
+ WHERE c.contype = 'f'
5685
+ AND t1.relname = 'slugs'
5686
+ AND t3.nspname = ANY (current_schemas(false))
5687
+ ORDER BY c.conname
5688
+
5689
+  (1.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
5690
+ FROM pg_constraint c
5691
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5692
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5693
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5694
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5695
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5696
+ WHERE c.contype = 'f'
5697
+ AND t1.relname = 'users'
5698
+ AND t3.nspname = ANY (current_schemas(false))
5699
+ ORDER BY c.conname
5700
+ 
5701
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
5702
+  (0.2ms) BEGIN
5703
+ ---------------------
5704
+ TaskTest: test_import
5705
+ ---------------------
5706
+  (0.1ms) SAVEPOINT active_record_1
5707
+  (1.0ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5708
+ SQL (0.4ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar shop"], ["slug", "guitar-shop"], ["created_at", "2016-12-13 20:36:00.989448"], ["updated_at", "2016-12-13 20:36:00.989448"]]
5709
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 1]]
5710
+ SQL (0.5ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop"], ["sluggable_type", "Shop"], ["sluggable_id", 1], ["created_at", "2016-12-13 20:36:00.998658"], ["updated_at", "2016-12-13 20:36:00.998658"]]
5711
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5712
+  (0.1ms) SAVEPOINT active_record_1
5713
+  (0.6ms) SELECT "categories"."slug" FROM "categories" WHERE "categories"."shop_id" = $1 AND (slug ~ '^electric(-[0-9]+)?$') ORDER BY "categories"."slug" DESC LIMIT 1 [["shop_id", 1]]
5714
+ SQL (0.3ms) INSERT INTO "categories" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Electric"], ["shop_id", 1], ["slug", "electric"], ["created_at", "2016-12-13 20:36:01.013597"], ["updated_at", "2016-12-13 20:36:01.013597"]]
5715
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
5716
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "electric"], ["sluggable_type", "Category"], ["sluggable_id", 1], ["created_at", "2016-12-13 20:36:01.016261"], ["updated_at", "2016-12-13 20:36:01.016261"]]
5717
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5718
+ Slugs::Slug Load (0.2ms) SELECT "slugs".* FROM "slugs"
5719
+  (0.1ms) SAVEPOINT active_record_1
5720
+ SQL (0.2ms) DELETE FROM "slugs" WHERE "slugs"."id" = $1 [["id", 1]]
5721
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5722
+  (0.1ms) SAVEPOINT active_record_1
5723
+ SQL (0.2ms) DELETE FROM "slugs" WHERE "slugs"."id" = $1 [["id", 2]]
5724
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5725
+ Shop Load (0.5ms) SELECT "shops".* FROM "shops" ORDER BY "shops"."id" ASC LIMIT 1000
5726
+  (0.1ms) SAVEPOINT active_record_1
5727
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 1]]
5728
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_id", "sluggable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop"], ["sluggable_id", 1], ["sluggable_type", "Shop"], ["created_at", "2016-12-13 20:36:01.023065"], ["updated_at", "2016-12-13 20:36:01.023065"]]
5729
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5730
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."id" ASC LIMIT 1000
5731
+  (0.1ms) SAVEPOINT active_record_1
5732
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
5733
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_id", "sluggable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "electric"], ["sluggable_id", 1], ["sluggable_type", "Category"], ["created_at", "2016-12-13 20:36:01.026189"], ["updated_at", "2016-12-13 20:36:01.026189"]]
5734
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5735
+  (0.2ms) SELECT "slugs"."value" FROM "slugs"
5736
+  (0.1ms) ROLLBACK
5737
+  (0.1ms) BEGIN
5738
+ ----------------------------
5739
+ GeneratorsTest: test_install
5740
+ ----------------------------
5741
+  (0.2ms) ROLLBACK
5742
+  (0.1ms) BEGIN
5743
+ ------------------------------------
5744
+ RouteTest: test_optimized_url_helper
5745
+ ------------------------------------
5746
+  (0.1ms) SAVEPOINT active_record_1
5747
+  (0.3ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5748
+ SQL (0.3ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar Shop"], ["slug", "guitar-shop"], ["created_at", "2016-12-13 20:36:01.037147"], ["updated_at", "2016-12-13 20:36:01.037147"]]
5749
+ Shop Load (0.3ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 2]]
5750
+ SQL (0.4ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop"], ["sluggable_type", "Shop"], ["sluggable_id", 2], ["created_at", "2016-12-13 20:36:01.039518"], ["updated_at", "2016-12-13 20:36:01.039518"]]
5751
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5752
+  (0.2ms) ROLLBACK
5753
+  (0.1ms) BEGIN
5754
+ -------------------------
5755
+ RouteTest: test_generator
5756
+ -------------------------
5757
+  (0.1ms) SAVEPOINT active_record_1
5758
+  (0.4ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5759
+ SQL (0.2ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar Shop"], ["slug", "guitar-shop"], ["created_at", "2016-12-13 20:36:01.048231"], ["updated_at", "2016-12-13 20:36:01.048231"]]
5760
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 3]]
5761
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop"], ["sluggable_type", "Shop"], ["sluggable_id", 3], ["created_at", "2016-12-13 20:36:01.050398"], ["updated_at", "2016-12-13 20:36:01.050398"]]
5762
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5763
+  (0.1ms) ROLLBACK
5764
+  (0.1ms) BEGIN
5765
+ ------------------------
5766
+ RecordTest: test_finders
5767
+ ------------------------
5768
+  (0.2ms) SAVEPOINT active_record_1
5769
+  (0.6ms) SELECT "users"."slug" FROM "users" WHERE (slug ~ '^zakk-wylde(-[0-9]+)?$') ORDER BY "users"."slug" DESC LIMIT 1
5770
+ SQL (0.7ms) INSERT INTO "users" ("first_name", "last_name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["first_name", "Zakk"], ["last_name", "Wylde"], ["slug", "zakk-wylde"], ["created_at", "2016-12-13 20:36:01.065757"], ["updated_at", "2016-12-13 20:36:01.065757"]]
5771
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5772
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "zakk-wylde"], ["sluggable_type", "User"], ["sluggable_id", 1], ["created_at", "2016-12-13 20:36:01.069426"], ["updated_at", "2016-12-13 20:36:01.069426"]]
5773
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5774
+ User Exists (0.3ms) SELECT 1 AS one FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5775
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5776
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5777
+ User Load (0.3ms) SELECT "users".* FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 ORDER BY "slugs"."id" DESC LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5778
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5779
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5780
+  (0.1ms) SAVEPOINT active_record_1
5781
+  (0.4ms) SELECT "users"."slug" FROM "users" WHERE (slug ~ '^yngwie-malmsteen(-[0-9]+)?$') AND ("users"."id" != $1) ORDER BY "users"."slug" DESC LIMIT 1 [["id", 1]]
5782
+ SQL (0.2ms) UPDATE "users" SET "first_name" = $1, "last_name" = $2, "slug" = $3, "updated_at" = $4 WHERE "users"."id" = $5 [["first_name", "Yngwie"], ["last_name", "Malmsteen"], ["slug", "yngwie-malmsteen"], ["updated_at", "2016-12-13 20:36:01.088599"], ["id", 1]]
5783
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5784
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_id", "sluggable_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "yngwie-malmsteen"], ["sluggable_id", 1], ["sluggable_type", "User"], ["created_at", "2016-12-13 20:36:01.091285"], ["updated_at", "2016-12-13 20:36:01.091285"]]
5785
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5786
+ User Exists (0.3ms) SELECT 1 AS one FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5787
+ User Load (0.3ms) SELECT "users".* FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 ORDER BY "slugs"."id" DESC LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5788
+ User Exists (0.3ms) SELECT 1 AS one FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 LIMIT 1 [["sluggable_type", "User"], ["value", "yngwie-malmsteen"]]
5789
+ User Load (0.3ms) SELECT "users".* FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 ORDER BY "slugs"."id" DESC LIMIT 1 [["sluggable_type", "User"], ["value", "yngwie-malmsteen"]]
5790
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5791
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
5792
+  (0.1ms) SAVEPOINT active_record_1
5793
+  (0.2ms) SELECT "users"."slug" FROM "users" WHERE (slug ~ '^zakk-wylde(-[0-9]+)?$') ORDER BY "users"."slug" DESC LIMIT 1
5794
+ SQL (0.2ms) INSERT INTO "users" ("first_name", "last_name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["first_name", "Zakk"], ["last_name", "Wylde"], ["slug", "zakk-wylde"], ["created_at", "2016-12-13 20:36:01.100280"], ["updated_at", "2016-12-13 20:36:01.100280"]]
5795
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
5796
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "zakk-wylde"], ["sluggable_type", "User"], ["sluggable_id", 2], ["created_at", "2016-12-13 20:36:01.101983"], ["updated_at", "2016-12-13 20:36:01.101983"]]
5797
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5798
+ User Exists (0.3ms) SELECT 1 AS one FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5799
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
5800
+ User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
5801
+ User Load (0.3ms) SELECT "users".* FROM "users" INNER JOIN "slugs" ON "slugs"."sluggable_id" = "users"."id" AND "slugs"."sluggable_type" = $1 WHERE "slugs"."value" = $2 ORDER BY "slugs"."id" DESC LIMIT 1 [["sluggable_type", "User"], ["value", "zakk-wylde"]]
5802
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
5803
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
5804
+  (0.1ms) SAVEPOINT active_record_1
5805
+ SQL (0.3ms) INSERT INTO "domains" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-12-13 20:36:01.113391"], ["updated_at", "2016-12-13 20:36:01.113391"]]
5806
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5807
+ Domain Load (0.2ms) SELECT "domains".* FROM "domains" WHERE "domains"."id" = $1 LIMIT 1 [["id", 1]]
5808
+ Domain Exists (0.2ms) SELECT 1 AS one FROM "domains" WHERE "domains"."id" = $1 LIMIT 1 [["id", 2]]
5809
+  (0.1ms) ROLLBACK
5810
+  (0.1ms) BEGIN
5811
+ ------------------------
5812
+ RecordTest: test_indices
5813
+ ------------------------
5814
+  (0.1ms) SAVEPOINT active_record_1
5815
+  (0.2ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5816
+ SQL (0.2ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar Shop"], ["slug", "guitar-shop"], ["created_at", "2016-12-13 20:36:01.121161"], ["updated_at", "2016-12-13 20:36:01.121161"]]
5817
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 4]]
5818
+ SQL (0.4ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop"], ["sluggable_type", "Shop"], ["sluggable_id", 4], ["created_at", "2016-12-13 20:36:01.123015"], ["updated_at", "2016-12-13 20:36:01.123015"]]
5819
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5820
+  (0.1ms) SAVEPOINT active_record_1
5821
+  (0.3ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5822
+ SQL (0.2ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar Shop"], ["slug", "guitar-shop-1"], ["created_at", "2016-12-13 20:36:01.128519"], ["updated_at", "2016-12-13 20:36:01.128519"]]
5823
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 5]]
5824
+ SQL (0.5ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop-1"], ["sluggable_type", "Shop"], ["sluggable_id", 5], ["created_at", "2016-12-13 20:36:01.130718"], ["updated_at", "2016-12-13 20:36:01.130718"]]
5825
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5826
+  (0.1ms) SAVEPOINT active_record_1
5827
+  (0.3ms) SELECT "shops"."slug" FROM "shops" WHERE (slug ~ '^guitar-shop(-[0-9]+)?$') ORDER BY "shops"."slug" DESC LIMIT 1
5828
+ SQL (0.2ms) INSERT INTO "shops" ("name", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Guitar Shop"], ["slug", "guitar-shop-2"], ["created_at", "2016-12-13 20:36:01.136350"], ["updated_at", "2016-12-13 20:36:01.136350"]]
5829
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = $1 LIMIT 1 [["id", 6]]
5830
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "guitar-shop-2"], ["sluggable_type", "Shop"], ["sluggable_id", 6], ["created_at", "2016-12-13 20:36:01.138042"], ["updated_at", "2016-12-13 20:36:01.138042"]]
5831
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5832
+ Shop Load (0.3ms) SELECT "shops".* FROM "shops" ORDER BY "shops"."id" ASC LIMIT 1
5833
+  (0.2ms) SAVEPOINT active_record_1
5834
+  (0.4ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 4]]
5835
+ SQL (0.3ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 4], ["slug", "les-paul"], ["created_at", "2016-12-13 20:36:01.153382"], ["updated_at", "2016-12-13 20:36:01.153382"]]
5836
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]
5837
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul"], ["sluggable_type", "Product"], ["sluggable_id", 1], ["created_at", "2016-12-13 20:36:01.156464"], ["updated_at", "2016-12-13 20:36:01.156464"]]
5838
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5839
+  (0.2ms) SAVEPOINT active_record_1
5840
+  (0.2ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 4]]
5841
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 4], ["slug", "les-paul-1"], ["created_at", "2016-12-13 20:36:01.160196"], ["updated_at", "2016-12-13 20:36:01.160196"]]
5842
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 2]]
5843
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul-1"], ["sluggable_type", "Product"], ["sluggable_id", 2], ["created_at", "2016-12-13 20:36:01.162230"], ["updated_at", "2016-12-13 20:36:01.162230"]]
5844
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5845
+  (0.2ms) SAVEPOINT active_record_1
5846
+  (0.3ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 4]]
5847
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 4], ["slug", "les-paul-2"], ["created_at", "2016-12-13 20:36:01.171859"], ["updated_at", "2016-12-13 20:36:01.171859"]]
5848
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 3]]
5849
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul-2"], ["sluggable_type", "Product"], ["sluggable_id", 3], ["created_at", "2016-12-13 20:36:01.173425"], ["updated_at", "2016-12-13 20:36:01.173425"]]
5850
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5851
+ Shop Load (0.2ms) SELECT "shops".* FROM "shops" ORDER BY "shops"."id" DESC LIMIT 1
5852
+  (0.1ms) SAVEPOINT active_record_1
5853
+  (0.2ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 6]]
5854
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 6], ["slug", "les-paul"], ["created_at", "2016-12-13 20:36:01.176753"], ["updated_at", "2016-12-13 20:36:01.176753"]]
5855
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 4]]
5856
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul"], ["sluggable_type", "Product"], ["sluggable_id", 4], ["created_at", "2016-12-13 20:36:01.178265"], ["updated_at", "2016-12-13 20:36:01.178265"]]
5857
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5858
+  (0.1ms) SAVEPOINT active_record_1
5859
+  (0.2ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 6]]
5860
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 6], ["slug", "les-paul-1"], ["created_at", "2016-12-13 20:36:01.180863"], ["updated_at", "2016-12-13 20:36:01.180863"]]
5861
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 5]]
5862
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul-1"], ["sluggable_type", "Product"], ["sluggable_id", 5], ["created_at", "2016-12-13 20:36:01.182301"], ["updated_at", "2016-12-13 20:36:01.182301"]]
5863
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5864
+  (0.1ms) SAVEPOINT active_record_1
5865
+  (0.2ms) SELECT "products"."slug" FROM "products" WHERE "products"."shop_id" = $1 AND "products"."category_id" IS NULL AND (slug ~ '^les-paul(-[0-9]+)?$') ORDER BY "products"."slug" DESC LIMIT 1 [["shop_id", 6]]
5866
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Les Paul"], ["shop_id", 6], ["slug", "les-paul-2"], ["created_at", "2016-12-13 20:36:01.184866"], ["updated_at", "2016-12-13 20:36:01.184866"]]
5867
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 6]]
5868
+ SQL (0.2ms) INSERT INTO "slugs" ("value", "sluggable_type", "sluggable_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["value", "les-paul-2"], ["sluggable_type", "Product"], ["sluggable_id", 6], ["created_at", "2016-12-13 20:36:01.186273"], ["updated_at", "2016-12-13 20:36:01.186273"]]
5869
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5870
+  (0.1ms) ROLLBACK
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slugs
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.2
4
+ version: 4.0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmontossi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-08 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails