listable_collections 4.0.0.0 → 4.0.0.1

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: d24fa57f2147098a953be884e946953fa76784b1
4
- data.tar.gz: 844f27132035fdd47d45ff610c4b1d8a8b674ec3
3
+ metadata.gz: 254f443d254032f05cc8bba08c521a82d2180165
4
+ data.tar.gz: 2ae78c4b3a02a460b200840020f6dd34b5a68a7a
5
5
  SHA512:
6
- metadata.gz: d1bc7db6dd7c1f4c60c83ed900c2faaeb0d27ef5681af1386839f590aa740d5190548fb19516ce9f599ce69551545661d715696c8749dcda48ae83bec8fc993d
7
- data.tar.gz: 113d599208001932f8516035ef8aa4feb1fc3c4fc7bc3ca87bb30b761e27c1a3cd49e9951d0f4daeadbab6da45917780b5d1af2a89fb8501104843f10d122a90
6
+ metadata.gz: 8eefb5e9bf7504190f564aead44481e9a59f63b312f429c1fff18cdf8e26cba5f122e8a48ede9a4009531b8c9fe22eb56beab156967c09da5a292437b9b4dc49
7
+ data.tar.gz: 0b42fce70bb530ce461838c689dcf410487dffc56ad425c78aee9820526641d5bb1fa082fb852af977becff9f79b5421bbaa093cd4522a37f27429a0e04b8af4
data/README.md CHANGED
@@ -100,6 +100,12 @@ class Shop < ActiveRecord::Base
100
100
  end
101
101
  ```
102
102
 
103
+ ## Contributing
104
+
105
+ Any issue, pull request, comment of any kind is more than welcome!
106
+
107
+ I will mainly ensure compatibility to PostgreSQL, AWS, Redis, Elasticsearch, FreeBSD and Memcached. 
108
+
103
109
  ## Credits
104
110
 
105
111
  This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).
@@ -1,10 +1,12 @@
1
1
  module ListableCollections
2
2
  class Railtie < Rails::Railtie
3
3
 
4
- initializer 'listable_collections.extensions' do
5
- ::ActiveRecord::Base.include(
6
- ListableCollections::Extensions::ActiveRecord::Base
7
- )
4
+ initializer 'listable_collections.active_record' do
5
+ ActiveSupport.on_load :active_record do
6
+ ::ActiveRecord::Base.include(
7
+ ListableCollections::Extensions::ActiveRecord::Base
8
+ )
9
+ end
8
10
  end
9
11
 
10
12
  end
@@ -1,5 +1,5 @@
1
1
  module ListableCollections
2
2
 
3
- VERSION = '4.0.0.0'
3
+ VERSION = '4.0.0.1'
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: listable_collections_development
4
7
 
5
8
  test:
6
- adapter: postgresql
9
+ <<: *default
7
10
  database: listable_collections_test
@@ -0,0 +1,33 @@
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: 20160916011451) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "products", force: :cascade do |t|
20
+ t.integer "shop_id"
21
+ t.string "name"
22
+ t.text "sizes"
23
+ t.datetime "created_at", null: false
24
+ t.datetime "updated_at", null: false
25
+ end
26
+
27
+ create_table "shops", force: :cascade do |t|
28
+ t.string "name"
29
+ t.datetime "created_at", null: false
30
+ t.datetime "updated_at", null: false
31
+ end
32
+
33
+ end
@@ -0,0 +1,76 @@
1
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateShops (20160916011427)
5
+  (0.1ms) BEGIN
6
+  (19.4ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
7
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011427"]]
8
+  (0.5ms) COMMIT
9
+ Migrating to CreateProducts (20160916011451)
10
+  (5.6ms) BEGIN
11
+  (19.6ms) CREATE TABLE "products" ("id" serial primary key, "shop_id" integer, "name" character varying, "sizes" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
12
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011451"]]
13
+  (0.6ms) COMMIT
14
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
+  (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
16
+ FROM pg_constraint c
17
+ JOIN pg_class t1 ON c.conrelid = t1.oid
18
+ JOIN pg_class t2 ON c.confrelid = t2.oid
19
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
20
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
21
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
22
+ WHERE c.contype = 'f'
23
+ AND t1.relname = 'products'
24
+ AND t3.nspname = ANY (current_schemas(false))
25
+ ORDER BY c.conname
26
+ 
27
+  (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
28
+ FROM pg_constraint c
29
+ JOIN pg_class t1 ON c.conrelid = t1.oid
30
+ JOIN pg_class t2 ON c.confrelid = t2.oid
31
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
32
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
33
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
34
+ WHERE c.contype = 'f'
35
+ AND t1.relname = 'shops'
36
+ AND t3.nspname = ANY (current_schemas(false))
37
+ ORDER BY c.conname
38
+
39
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
40
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
41
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
42
+ Migrating to CreateShops (20160916011427)
43
+  (0.2ms) BEGIN
44
+  (2.5ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
45
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011427"]]
46
+  (0.4ms) COMMIT
47
+ Migrating to CreateProducts (20160916011451)
48
+  (0.2ms) BEGIN
49
+  (2.0ms) CREATE TABLE "products" ("id" serial primary key, "shop_id" integer, "name" character varying, "sizes" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
50
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011451"]]
51
+  (2.2ms) COMMIT
52
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
53
+  (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
54
+ FROM pg_constraint c
55
+ JOIN pg_class t1 ON c.conrelid = t1.oid
56
+ JOIN pg_class t2 ON c.confrelid = t2.oid
57
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
58
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
59
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
60
+ WHERE c.contype = 'f'
61
+ AND t1.relname = 'products'
62
+ AND t3.nspname = ANY (current_schemas(false))
63
+ ORDER BY c.conname
64
+ 
65
+  (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
66
+ FROM pg_constraint c
67
+ JOIN pg_class t1 ON c.conrelid = t1.oid
68
+ JOIN pg_class t2 ON c.confrelid = t2.oid
69
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
70
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
71
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
72
+ WHERE c.contype = 'f'
73
+ AND t1.relname = 'shops'
74
+ AND t3.nspname = ANY (current_schemas(false))
75
+ ORDER BY c.conname
76
+
@@ -22,3 +22,103 @@ AssociationTest: test_methods
22
22
  SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 14], ["created_at", "2016-11-21 06:16:21.528027"], ["updated_at", "2016-11-21 06:16:21.528027"]]
23
23
   (0.1ms) RELEASE SAVEPOINT active_record_1
24
24
   (0.2ms) ROLLBACK
25
+ ActiveRecord::SchemaMigration Load (27.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
26
+  (0.2ms) BEGIN
27
+ ---------------------------
28
+ AttributeTest: test_methods
29
+ ---------------------------
30
+  (0.2ms) ROLLBACK
31
+  (0.1ms) BEGIN
32
+ -----------------------------
33
+ AssociationTest: test_methods
34
+ -----------------------------
35
+  (0.2ms) SAVEPOINT active_record_1
36
+ SQL (20.0ms) INSERT INTO "shops" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2016-12-13 19:57:11.619475"], ["updated_at", "2016-12-13 19:57:11.619475"]]
37
+  (0.2ms) RELEASE SAVEPOINT active_record_1
38
+  (0.2ms) SAVEPOINT active_record_1
39
+ SQL (19.3ms) INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPhone"], ["shop_id", 15], ["created_at", "2016-12-13 19:57:11.655713"], ["updated_at", "2016-12-13 19:57:11.655713"]]
40
+  (0.2ms) RELEASE SAVEPOINT active_record_1
41
+  (0.2ms) SAVEPOINT active_record_1
42
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iPad"], ["shop_id", 15], ["created_at", "2016-12-13 19:57:11.677200"], ["updated_at", "2016-12-13 19:57:11.677200"]]
43
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."shop_id" = $1 [["shop_id", 15]]
45
+  (0.1ms) SAVEPOINT active_record_1
46
+ SQL (0.2ms) INSERT INTO "products" ("name", "shop_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "iMac"], ["shop_id", 15], ["created_at", "2016-12-13 19:57:11.682005"], ["updated_at", "2016-12-13 19:57:11.682005"]]
47
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48
+  (0.1ms) ROLLBACK
49
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
50
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
51
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
52
+ Migrating to CreateShops (20160916011427)
53
+  (0.1ms) BEGIN
54
+  (2.9ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
55
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011427"]]
56
+  (0.5ms) COMMIT
57
+ Migrating to CreateProducts (20160916011451)
58
+  (0.2ms) BEGIN
59
+  (2.1ms) CREATE TABLE "products" ("id" serial primary key, "shop_id" integer, "name" character varying, "sizes" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
60
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011451"]]
61
+  (0.5ms) COMMIT
62
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
63
+  (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
64
+ FROM pg_constraint c
65
+ JOIN pg_class t1 ON c.conrelid = t1.oid
66
+ JOIN pg_class t2 ON c.confrelid = t2.oid
67
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
68
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
69
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
70
+ WHERE c.contype = 'f'
71
+ AND t1.relname = 'products'
72
+ AND t3.nspname = ANY (current_schemas(false))
73
+ ORDER BY c.conname
74
+ 
75
+  (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
76
+ FROM pg_constraint c
77
+ JOIN pg_class t1 ON c.conrelid = t1.oid
78
+ JOIN pg_class t2 ON c.confrelid = t2.oid
79
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
80
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
81
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
82
+ WHERE c.contype = 'f'
83
+ AND t1.relname = 'shops'
84
+ AND t3.nspname = ANY (current_schemas(false))
85
+ ORDER BY c.conname
86
+
87
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
88
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
89
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
90
+ Migrating to CreateShops (20160916011427)
91
+  (0.1ms) BEGIN
92
+  (2.6ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
93
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011427"]]
94
+  (0.6ms) COMMIT
95
+ Migrating to CreateProducts (20160916011451)
96
+  (0.3ms) BEGIN
97
+  (2.3ms) CREATE TABLE "products" ("id" serial primary key, "shop_id" integer, "name" character varying, "sizes" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
98
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160916011451"]]
99
+  (0.4ms) COMMIT
100
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
101
+  (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
102
+ FROM pg_constraint c
103
+ JOIN pg_class t1 ON c.conrelid = t1.oid
104
+ JOIN pg_class t2 ON c.confrelid = t2.oid
105
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
106
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
107
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
108
+ WHERE c.contype = 'f'
109
+ AND t1.relname = 'products'
110
+ AND t3.nspname = ANY (current_schemas(false))
111
+ ORDER BY c.conname
112
+ 
113
+  (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
114
+ FROM pg_constraint c
115
+ JOIN pg_class t1 ON c.conrelid = t1.oid
116
+ JOIN pg_class t2 ON c.confrelid = t2.oid
117
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
118
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
119
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
120
+ WHERE c.contype = 'f'
121
+ AND t1.relname = 'shops'
122
+ AND t3.nspname = ANY (current_schemas(false))
123
+ ORDER BY c.conname
124
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listable_collections
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.0
4
+ version: 4.0.0.1
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-06 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
@@ -109,6 +109,8 @@ files:
109
109
  - test/dummy/config/secrets.yml
110
110
  - test/dummy/db/migrate/20160916011427_create_shops.rb
111
111
  - test/dummy/db/migrate/20160916011451_create_products.rb
112
+ - test/dummy/db/schema.rb
113
+ - test/dummy/log/development.log
112
114
  - test/dummy/log/test.log
113
115
  - test/dummy/public/404.html
114
116
  - test/dummy/public/422.html
@@ -175,6 +177,8 @@ test_files:
175
177
  - test/dummy/config.ru
176
178
  - test/dummy/db/migrate/20160916011427_create_shops.rb
177
179
  - test/dummy/db/migrate/20160916011451_create_products.rb
180
+ - test/dummy/db/schema.rb
181
+ - test/dummy/log/development.log
178
182
  - test/dummy/log/test.log
179
183
  - test/dummy/public/404.html
180
184
  - test/dummy/public/422.html