categorical 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +33 -0
  4. data/app/models/categorical/tag.rb +5 -0
  5. data/app/models/categorical/tagging.rb +6 -0
  6. data/db/migrate/20150919153408_create_categorical_tags.rb +9 -0
  7. data/db/migrate/20151011215525_create_categorical_taggings.rb +8 -0
  8. data/db/migrate/20151015173150_add_index_to_tags.rb +5 -0
  9. data/lib/categorical.rb +6 -0
  10. data/lib/categorical/concerns/models/tag.rb +39 -0
  11. data/lib/categorical/engine.rb +5 -0
  12. data/lib/categorical/taggable.rb +10 -0
  13. data/lib/categorical/version.rb +3 -0
  14. data/lib/tasks/categorical_tasks.rake +4 -0
  15. data/test/categorical_test.rb +7 -0
  16. data/test/dummy/README.rdoc +28 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/javascripts/application.js +13 -0
  19. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  20. data/test/dummy/app/controllers/application_controller.rb +5 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/models/post.rb +3 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/bin/bundle +3 -0
  25. data/test/dummy/bin/rails +4 -0
  26. data/test/dummy/bin/rake +4 -0
  27. data/test/dummy/bin/setup +29 -0
  28. data/test/dummy/config.ru +4 -0
  29. data/test/dummy/config/application.rb +13 -0
  30. data/test/dummy/config/boot.rb +5 -0
  31. data/test/dummy/config/database.yml +12 -0
  32. data/test/dummy/config/environment.rb +5 -0
  33. data/test/dummy/config/environments/development.rb +41 -0
  34. data/test/dummy/config/environments/production.rb +79 -0
  35. data/test/dummy/config/environments/test.rb +42 -0
  36. data/test/dummy/config/initializers/assets.rb +11 -0
  37. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  38. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +4 -0
  42. data/test/dummy/config/initializers/session_store.rb +3 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +23 -0
  45. data/test/dummy/config/routes.rb +4 -0
  46. data/test/dummy/config/secrets.yml +22 -0
  47. data/test/dummy/db/migrate/20151003185718_create_posts.rb +9 -0
  48. data/test/dummy/db/schema.rb +41 -0
  49. data/test/dummy/log/development.log +241 -0
  50. data/test/dummy/log/test.log +6583 -0
  51. data/test/dummy/public/404.html +67 -0
  52. data/test/dummy/public/422.html +67 -0
  53. data/test/dummy/public/500.html +66 -0
  54. data/test/dummy/public/favicon.ico +0 -0
  55. data/test/models/categorical/concerns/taggable_test.rb +15 -0
  56. data/test/models/categorical/tag_test.rb +53 -0
  57. data/test/models/categorical/tagging_test.rb +25 -0
  58. data/test/test_helper.rb +12 -0
  59. metadata +202 -0
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
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
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # 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 Categorical::Engine => "/categorical"
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: 0341667dfe0533a789f1dc8c873bec0e47eddadb7647de9ac26a6dbf5afd5872092e77847dfbf15686d18c75b46301582bc6ce445fbb38eda722145404e10d0d
15
+
16
+ test:
17
+ secret_key_base: 7192c171cd38276a0bda733423decd9d87bdfbc7e789326974706937a22e984be0a5a14251af9292b36e32adf7f24be7c7335d34b221527d4900ffff00ce35c3
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,9 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,41 @@
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: 20151015173150) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "categorical_taggings", force: :cascade do |t|
20
+ t.integer "taggable_id"
21
+ t.string "taggable_type"
22
+ t.integer "tag_id"
23
+ end
24
+
25
+ add_index "categorical_taggings", ["taggable_type", "taggable_id"], name: "index_categorical_taggings_on_taggable_type_and_taggable_id", using: :btree
26
+
27
+ create_table "categorical_tags", force: :cascade do |t|
28
+ t.string "label"
29
+ t.datetime "created_at", null: false
30
+ t.datetime "updated_at", null: false
31
+ end
32
+
33
+ add_index "categorical_tags", ["label"], name: "index_categorical_tags_on_label", unique: true, using: :btree
34
+
35
+ create_table "posts", force: :cascade do |t|
36
+ t.string "title"
37
+ t.datetime "created_at", null: false
38
+ t.datetime "updated_at", null: false
39
+ end
40
+
41
+ end
@@ -0,0 +1,241 @@
1
+  (16.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2
+  (4.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateCategoricalTags (20150919153408)
5
+  (0.9ms) BEGIN
6
+  (9.4ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
7
+ SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150919153408"]]
8
+  (0.7ms) COMMIT
9
+ ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
+  (6.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
11
+ FROM pg_constraint c
12
+ JOIN pg_class t1 ON c.conrelid = t1.oid
13
+ JOIN pg_class t2 ON c.confrelid = t2.oid
14
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
15
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
16
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
17
+ WHERE c.contype = 'f'
18
+ AND t1.relname = 'categorical_tags'
19
+ AND t3.nspname = ANY (current_schemas(false))
20
+ ORDER BY c.conname
21
+ 
22
+ SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
23
+  (5.2ms) DROP TABLE "categorical_tags" CASCADE
24
+  (6.2ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
25
+  (1.2ms) SELECT version FROM "schema_migrations"
26
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
27
+  (7.6ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
28
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
29
+  (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
30
+  (0.8ms) SELECT version FROM "schema_migrations"
31
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
32
+ ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
33
+ ActiveRecord::SchemaMigration Load (2.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
34
+ Migrating to CreatePosts (20151003185718)
35
+  (0.3ms) BEGIN
36
+  (22.1ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
37
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151003185718"]]
38
+  (0.7ms) COMMIT
39
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
40
+  (7.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
41
+ FROM pg_constraint c
42
+ JOIN pg_class t1 ON c.conrelid = t1.oid
43
+ JOIN pg_class t2 ON c.confrelid = t2.oid
44
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
45
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
46
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
47
+ WHERE c.contype = 'f'
48
+ AND t1.relname = 'categorical_tags'
49
+ AND t3.nspname = ANY (current_schemas(false))
50
+ ORDER BY c.conname
51
+ 
52
+  (155.9ms) 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
53
+ FROM pg_constraint c
54
+ JOIN pg_class t1 ON c.conrelid = t1.oid
55
+ JOIN pg_class t2 ON c.confrelid = t2.oid
56
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
57
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
58
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
59
+ WHERE c.contype = 'f'
60
+ AND t1.relname = 'posts'
61
+ AND t3.nspname = ANY (current_schemas(false))
62
+ ORDER BY c.conname
63
+
64
+  (130.3ms) DROP DATABASE IF EXISTS "categorical_development"
65
+  (134.5ms) DROP DATABASE IF EXISTS "categorical_test"
66
+  (262.8ms) CREATE DATABASE "categorical_development" ENCODING = 'unicode'
67
+  (270.9ms) CREATE DATABASE "categorical_test" ENCODING = 'unicode'
68
+ SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
69
+  (10.8ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
70
+  (8.6ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
71
+  (3.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
72
+  (5.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
73
+  (0.8ms) SELECT version FROM "schema_migrations"
74
+  (3.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151003185718')
75
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
76
+ SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
77
+  (13.9ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
78
+  (6.6ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
79
+  (4.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
80
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
81
+  (0.8ms) SELECT version FROM "schema_migrations"
82
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151003185718')
83
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
84
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
85
+ ActiveRecord::SchemaMigration Load (2.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
86
+ Migrating to CreateCategoricalTaggings (20151011215525)
87
+  (0.3ms) BEGIN
88
+  (49.2ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer) 
89
+  (2.5ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" ("taggable_type", "taggable_id")
90
+ SQL (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151011215525"]]
91
+  (3.7ms) COMMIT
92
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
93
+  (9.5ms) 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
94
+ FROM pg_constraint c
95
+ JOIN pg_class t1 ON c.conrelid = t1.oid
96
+ JOIN pg_class t2 ON c.confrelid = t2.oid
97
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
98
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
99
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
100
+ WHERE c.contype = 'f'
101
+ AND t1.relname = 'categorical_taggings'
102
+ AND t3.nspname = ANY (current_schemas(false))
103
+ ORDER BY c.conname
104
+
105
+  (4.0ms) 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
106
+ FROM pg_constraint c
107
+ JOIN pg_class t1 ON c.conrelid = t1.oid
108
+ JOIN pg_class t2 ON c.confrelid = t2.oid
109
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
110
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
111
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
112
+ WHERE c.contype = 'f'
113
+ AND t1.relname = 'categorical_tags'
114
+ AND t3.nspname = ANY (current_schemas(false))
115
+ ORDER BY c.conname
116
+ 
117
+  (4.0ms) 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
118
+ FROM pg_constraint c
119
+ JOIN pg_class t1 ON c.conrelid = t1.oid
120
+ JOIN pg_class t2 ON c.confrelid = t2.oid
121
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
122
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
123
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
124
+ WHERE c.contype = 'f'
125
+ AND t1.relname = 'posts'
126
+ AND t3.nspname = ANY (current_schemas(false))
127
+ ORDER BY c.conname
128
+
129
+ SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
130
+  (10.5ms) DROP TABLE "categorical_taggings" CASCADE
131
+  (12.7ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer) 
132
+  (1.9ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
133
+  (2.8ms) DROP TABLE "categorical_tags" CASCADE
134
+  (5.2ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
135
+  (3.6ms) DROP TABLE "posts" CASCADE
136
+  (6.4ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
137
+  (1.2ms) SELECT version FROM "schema_migrations"
138
+ SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
139
+  (7.1ms) DROP TABLE "categorical_taggings" CASCADE
140
+  (5.5ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer)
141
+  (1.8ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
142
+  (4.0ms) DROP TABLE "categorical_tags" CASCADE
143
+  (7.3ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
144
+  (3.2ms) DROP TABLE "posts" CASCADE
145
+  (6.3ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
146
+  (1.0ms) SELECT version FROM "schema_migrations"
147
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
148
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
149
+ ActiveRecord::SchemaMigration Load (2.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
150
+ Migrating to AddIndexToTags (20151015173150)
151
+  (1.3ms) BEGIN
152
+  (40.6ms) CREATE UNIQUE INDEX "index_categorical_tags_on_label" ON "categorical_tags" ("label")
153
+ SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151015173150"]]
154
+  (2.7ms) COMMIT
155
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
156
+  (5.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
157
+ FROM pg_constraint c
158
+ JOIN pg_class t1 ON c.conrelid = t1.oid
159
+ JOIN pg_class t2 ON c.confrelid = t2.oid
160
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
161
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
162
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
163
+ WHERE c.contype = 'f'
164
+ AND t1.relname = 'categorical_taggings'
165
+ AND t3.nspname = ANY (current_schemas(false))
166
+ ORDER BY c.conname
167
+ 
168
+  (4.1ms) 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
169
+ FROM pg_constraint c
170
+ JOIN pg_class t1 ON c.conrelid = t1.oid
171
+ JOIN pg_class t2 ON c.confrelid = t2.oid
172
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
173
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
174
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
175
+ WHERE c.contype = 'f'
176
+ AND t1.relname = 'categorical_tags'
177
+ AND t3.nspname = ANY (current_schemas(false))
178
+ ORDER BY c.conname
179
+
180
+  (5.9ms) 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
181
+ FROM pg_constraint c
182
+ JOIN pg_class t1 ON c.conrelid = t1.oid
183
+ JOIN pg_class t2 ON c.confrelid = t2.oid
184
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
185
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
186
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
187
+ WHERE c.contype = 'f'
188
+ AND t1.relname = 'posts'
189
+ AND t3.nspname = ANY (current_schemas(false))
190
+ ORDER BY c.conname
191
+ 
192
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
193
+  (5.4ms) DROP TABLE "categorical_taggings" CASCADE
194
+  (7.8ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer) 
195
+  (2.7ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
196
+  (3.0ms) DROP TABLE "categorical_tags" CASCADE
197
+  (4.7ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
198
+  (1.3ms) CREATE UNIQUE INDEX "index_categorical_tags_on_label" ON "categorical_tags" USING btree ("label")
199
+  (2.6ms) DROP TABLE "posts" CASCADE
200
+  (5.3ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
201
+  (0.9ms) SELECT version FROM "schema_migrations"
202
+ SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
203
+  (3.7ms) DROP TABLE "categorical_taggings" CASCADE
204
+  (6.4ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer) 
205
+  (1.8ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
206
+  (5.8ms) DROP TABLE "categorical_tags" CASCADE
207
+  (5.0ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
208
+  (1.6ms) CREATE UNIQUE INDEX "index_categorical_tags_on_label" ON "categorical_tags" USING btree ("label")
209
+  (2.6ms) DROP TABLE "posts" CASCADE
210
+  (4.7ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
211
+  (0.9ms) SELECT version FROM "schema_migrations"
212
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
213
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20151011215525')
214
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
215
+ SQL (1.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
216
+  (22.9ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer)
217
+  (2.2ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
218
+  (7.6ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
219
+  (1.5ms) CREATE UNIQUE INDEX "index_categorical_tags_on_label" ON "categorical_tags" USING btree ("label")
220
+  (6.7ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
221
+  (3.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
222
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
223
+  (0.8ms) SELECT version FROM "schema_migrations"
224
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20151015173150')
225
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20151003185718')
226
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
227
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151011215525')
228
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
229
+  (8.8ms) CREATE TABLE "categorical_taggings" ("id" serial primary key, "taggable_id" integer, "taggable_type" character varying, "tag_id" integer) 
230
+  (2.9ms) CREATE INDEX "index_categorical_taggings_on_taggable_type_and_taggable_id" ON "categorical_taggings" USING btree ("taggable_type", "taggable_id")
231
+  (5.6ms) CREATE TABLE "categorical_tags" ("id" serial primary key, "label" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
232
+  (1.7ms) CREATE UNIQUE INDEX "index_categorical_tags_on_label" ON "categorical_tags" USING btree ("label")
233
+  (6.2ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
234
+  (3.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
235
+  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
236
+  (0.8ms) SELECT version FROM "schema_migrations"
237
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20151015173150')
238
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20151003185718')
239
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150919153408')
240
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20151011215525')
241
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"