look_up_table 0.1.0.rc8 → 0.1.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/look_up_table/base.rb +155 -0
- data/lib/look_up_table/cache.rb +170 -0
- data/lib/look_up_table/method_missing.rb +22 -0
- data/lib/look_up_table/no_cache.rb +45 -0
- data/lib/look_up_table/version.rb +2 -1
- data/lib/look_up_table.rb +7 -268
- data/test/dummy/app/models/bar.rb +4 -0
- data/test/dummy/app/models/foo.rb +4 -0
- data/test/dummy/app/models/foobar.rb +9 -0
- data/test/dummy/config/database.yml +9 -14
- data/test/dummy/config/environments/test.rb +3 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20111024130333_create_foobars.rb +2 -1
- data/test/dummy/db/migrate/20111024130334_create_foos.rb +11 -0
- data/test/dummy/db/migrate/20111024130335_create_bars.rb +11 -0
- data/test/dummy/db/schema.rb +13 -1
- data/test/dummy/log/development.log +14 -0
- data/test/dummy/log/test.log +59 -0
- data/test/dummy/tmp/cache/3F4/570/Foobarid%2F0 +0 -0
- data/test/dummy/tmp/cache/3F5/580/Foobarid%2F1 +0 -0
- data/test/dummy/tmp/cache/45C/750/Foobarbar%2F0 +0 -0
- data/test/dummy/tmp/cache/45D/760/Foobarbar%2F1 +0 -0
- data/test/dummy/tmp/cache/45E/770/Foobarbar%2F2 +0 -0
- data/test/dummy/tmp/cache/45F/780/Foobarbar%2F3 +0 -0
- data/test/dummy/tmp/cache/460/790/Foobarbar%2F4 +0 -0
- data/test/dummy/tmp/cache/461/7A0/Foobarbar%2F5 +0 -0
- data/test/dummy/tmp/cache/462/7B0/Foobarbar%2F6 +0 -0
- data/test/dummy/tmp/cache/463/7C0/Foobarbar%2F7 +0 -0
- data/test/dummy/tmp/cache/464/7D0/Foobarbar%2F8 +0 -0
- data/test/dummy/tmp/cache/465/7E0/Foobarbar%2F9 +0 -0
- data/test/dummy/tmp/cache/46B/D60/Foobarfoo%2F0 +0 -0
- data/test/dummy/tmp/cache/46C/D70/Foobarfoo%2F1 +0 -0
- data/test/dummy/tmp/cache/46D/D80/Foobarfoo%2F2 +0 -0
- data/test/dummy/tmp/cache/46E/D90/Foobarfoo%2F3 +0 -0
- data/test/dummy/tmp/cache/46F/DA0/Foobarfoo%2F4 +0 -0
- data/test/dummy/tmp/cache/470/DB0/Foobarfoo%2F5 +0 -0
- data/test/dummy/tmp/cache/471/DC0/Foobarfoo%2F6 +0 -0
- data/test/dummy/tmp/cache/472/DD0/Foobarfoo%2F7 +0 -0
- data/test/dummy/tmp/cache/473/DE0/Foobarfoo%2F8 +0 -0
- data/test/dummy/tmp/cache/474/DF0/Foobarfoo%2F9 +0 -0
- data/test/dummy/tmp/cache/48D/030/Foobarbar%2F10 +0 -0
- data/test/dummy/tmp/cache/48E/040/Foobarbar%2F11 +0 -0
- data/test/dummy/tmp/cache/48E/050/Foobarbar%2F20 +0 -0
- data/test/dummy/tmp/cache/48F/050/Foobarbar%2F12 +0 -0
- data/test/dummy/tmp/cache/48F/060/Foobarbar%2F21 +0 -0
- data/test/dummy/tmp/cache/48F/070/Foobarbar%2F30 +0 -0
- data/test/dummy/tmp/cache/490/060/Foobarbar%2F13 +0 -0
- data/test/dummy/tmp/cache/490/070/Foobarbar%2F22 +0 -0
- data/test/dummy/tmp/cache/490/080/Foobarbar%2F31 +0 -0
- data/test/dummy/tmp/cache/490/090/Foobarbar%2F40 +0 -0
- data/test/dummy/tmp/cache/491/070/Foobarbar%2F14 +0 -0
- data/test/dummy/tmp/cache/491/080/Foobarbar%2F23 +0 -0
- data/test/dummy/tmp/cache/491/090/Foobarbar%2F32 +0 -0
- data/test/dummy/tmp/cache/491/0A0/Foobarbar%2F41 +0 -0
- data/test/dummy/tmp/cache/492/080/Foobarbar%2F15 +0 -0
- data/test/dummy/tmp/cache/492/090/Foobarbar%2F24 +0 -0
- data/test/dummy/tmp/cache/492/0A0/Foobarbar%2F33 +0 -0
- data/test/dummy/tmp/cache/493/090/Foobarbar%2F16 +0 -0
- data/test/dummy/tmp/cache/493/0A0/Foobarbar%2F25 +0 -0
- data/test/dummy/tmp/cache/493/0B0/Foobarbar%2F34 +0 -0
- data/test/dummy/tmp/cache/494/0A0/Foobarbar%2F17 +0 -0
- data/test/dummy/tmp/cache/494/0B0/Foobarbar%2F26 +0 -0
- data/test/dummy/tmp/cache/494/0C0/Foobarbar%2F35 +0 -0
- data/test/dummy/tmp/cache/495/0B0/Foobarbar%2F18 +0 -0
- data/test/dummy/tmp/cache/495/0C0/Foobarbar%2F27 +0 -0
- data/test/dummy/tmp/cache/495/0D0/Foobarbar%2F36 +0 -0
- data/test/dummy/tmp/cache/496/0C0/Foobarbar%2F19 +0 -0
- data/test/dummy/tmp/cache/496/0D0/Foobarbar%2F28 +0 -0
- data/test/dummy/tmp/cache/496/0E0/Foobarbar%2F37 +0 -0
- data/test/dummy/tmp/cache/497/0E0/Foobarbar%2F29 +0 -0
- data/test/dummy/tmp/cache/497/0F0/Foobarbar%2F38 +0 -0
- data/test/dummy/tmp/cache/498/100/Foobarbar%2F39 +0 -0
- data/test/dummy/tmp/cache/49C/730/Foobarfoo%2F10 +0 -0
- data/test/dummy/tmp/cache/49D/740/Foobarfoo%2F11 +0 -0
- data/test/dummy/tmp/cache/49D/750/Foobarfoo%2F20 +0 -0
- data/test/dummy/tmp/cache/49E/750/Foobarfoo%2F12 +0 -0
- data/test/dummy/tmp/cache/49E/760/Foobarfoo%2F21 +0 -0
- data/test/dummy/tmp/cache/49E/770/Foobarfoo%2F30 +0 -0
- data/test/dummy/tmp/cache/49F/760/Foobarfoo%2F13 +0 -0
- data/test/dummy/tmp/cache/49F/770/Foobarfoo%2F22 +0 -0
- data/test/dummy/tmp/cache/49F/780/Foobarfoo%2F31 +0 -0
- data/test/dummy/tmp/cache/49F/790/Foobarfoo%2F40 +0 -0
- data/test/dummy/tmp/cache/4A0/770/Foobarfoo%2F14 +0 -0
- data/test/dummy/tmp/cache/4A0/780/Foobarfoo%2F23 +0 -0
- data/test/dummy/tmp/cache/4A0/790/Foobarfoo%2F32 +0 -0
- data/test/dummy/tmp/cache/4A0/7A0/Foobarfoo%2F41 +0 -0
- data/test/dummy/tmp/cache/4A1/780/Foobarfoo%2F15 +0 -0
- data/test/dummy/tmp/cache/4A1/790/Foobarfoo%2F24 +0 -0
- data/test/dummy/tmp/cache/4A1/7A0/Foobarfoo%2F33 +0 -0
- data/test/dummy/tmp/cache/4A2/790/Foobarfoo%2F16 +0 -0
- data/test/dummy/tmp/cache/4A2/7A0/Foobarfoo%2F25 +0 -0
- data/test/dummy/tmp/cache/4A2/7B0/Foobarfoo%2F34 +0 -0
- data/test/dummy/tmp/cache/4A3/7A0/Foobarfoo%2F17 +0 -0
- data/test/dummy/tmp/cache/4A3/7B0/Foobarfoo%2F26 +0 -0
- data/test/dummy/tmp/cache/4A3/7C0/Foobarfoo%2F35 +0 -0
- data/test/dummy/tmp/cache/4A4/7B0/Foobarfoo%2F18 +0 -0
- data/test/dummy/tmp/cache/4A4/7C0/Foobarfoo%2F27 +0 -0
- data/test/dummy/tmp/cache/4A4/7D0/Foobarfoo%2F36 +0 -0
- data/test/dummy/tmp/cache/4A5/7C0/Foobarfoo%2F19 +0 -0
- data/test/dummy/tmp/cache/4A5/7D0/Foobarfoo%2F28 +0 -0
- data/test/dummy/tmp/cache/4A5/7E0/Foobarfoo%2F37 +0 -0
- data/test/dummy/tmp/cache/4A6/7E0/Foobarfoo%2F29 +0 -0
- data/test/dummy/tmp/cache/4A6/7F0/Foobarfoo%2F38 +0 -0
- data/test/dummy/tmp/cache/4A7/800/Foobarfoo%2F39 +0 -0
- metadata +191 -7
@@ -3,23 +3,18 @@
|
|
3
3
|
#
|
4
4
|
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
5
|
# gem 'sqlite3'
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
database:
|
7
|
+
database: lookup_table_dev
|
8
|
+
adapter: postgresql
|
9
|
+
username: werbeboten
|
10
|
+
password: werbeboten
|
11
11
|
|
12
12
|
# Warning: The database defined as "test" will be erased and
|
13
13
|
# re-generated from your development database when you run "rake".
|
14
14
|
# Do not set this db to the same as development or production.
|
15
15
|
test:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
database: lookup_table_test
|
17
|
+
adapter: postgresql
|
18
|
+
username: werbeboten
|
19
|
+
password: werbeboten
|
20
20
|
|
21
|
-
production:
|
22
|
-
adapter: sqlite3
|
23
|
-
database: db/production.sqlite3
|
24
|
-
pool: 5
|
25
|
-
timeout: 5000
|
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,13 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20111024130335) do
|
15
|
+
|
16
|
+
create_table "bars", :force => true do |t|
|
17
|
+
t.integer "bar"
|
18
|
+
t.datetime "created_at"
|
19
|
+
t.datetime "updated_at"
|
20
|
+
end
|
15
21
|
|
16
22
|
create_table "foobars", :force => true do |t|
|
17
23
|
t.string "foo"
|
@@ -20,4 +26,10 @@ ActiveRecord::Schema.define(:version => 20111024130333) do
|
|
20
26
|
t.datetime "updated_at"
|
21
27
|
end
|
22
28
|
|
29
|
+
create_table "foos", :force => true do |t|
|
30
|
+
t.string "foo"
|
31
|
+
t.datetime "created_at"
|
32
|
+
t.datetime "updated_at"
|
33
|
+
end
|
34
|
+
|
23
35
|
end
|
@@ -9,3 +9,17 @@ Migrating to CreateFoobars (20111024130333)
|
|
9
9
|
[1m[35m (0.5ms)[0m select sqlite_version(*)
|
10
10
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
11
11
|
[1m[35m (0.0ms)[0m PRAGMA index_list("foobars")
|
12
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
13
|
+
Migrating to CreateFoobars (20111024130333)
|
14
|
+
Migrating to CreateFoos (20111024130334)
|
15
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
16
|
+
[1m[36m (0.7ms)[0m [1mCREATE TABLE "foos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "foo" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
17
|
+
[1m[35m (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111024130334')
|
18
|
+
Migrating to CreateBars (20111024130335)
|
19
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "bars" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "bar" integer, "created_at" datetime, "updated_at" datetime) [0m
|
20
|
+
[1m[35m (0.6ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111024130335')
|
21
|
+
[1m[36m (0.3ms)[0m [1mselect sqlite_version(*)[0m
|
22
|
+
[1m[35m (0.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
23
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("bars")[0m
|
24
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("foobars")
|
25
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("foos")[0m
|
data/test/dummy/log/test.log
CHANGED
@@ -9,3 +9,62 @@ Migrating to CreateFoobars (20111024130333)
|
|
9
9
|
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
10
10
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
11
11
|
[1m[35m (0.1ms)[0m PRAGMA index_list("foobars")
|
12
|
+
[1m[36m (28.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
13
|
+
[1m[35m (0.3ms)[0m SHOW search_path
|
14
|
+
[1m[36m (2.9ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
15
|
+
FROM pg_class t
|
16
|
+
INNER JOIN pg_index d ON t.oid = d.indrelid
|
17
|
+
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
18
|
+
WHERE i.relkind = 'i'
|
19
|
+
AND d.indisprimary = 'f'
|
20
|
+
AND t.relname = 'schema_migrations'
|
21
|
+
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
22
|
+
ORDER BY i.relname
|
23
|
+
[0m
|
24
|
+
[1m[35m (73.5ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
25
|
+
[1m[36m (0.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
26
|
+
Migrating to CreateFoobars (20111024130333)
|
27
|
+
[1m[35m (0.1ms)[0m BEGIN
|
28
|
+
[1m[36m (34.4ms)[0m [1mCREATE TABLE "foobars" ("id" serial primary key, "foo" character varying(255), "bar" integer, "created_at" timestamp, "updated_at" timestamp) [0m
|
29
|
+
[1m[35m (0.5ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111024130333')
|
30
|
+
[1m[36m (15.0ms)[0m [1mCOMMIT[0m
|
31
|
+
Migrating to CreateFoos (20111024130334)
|
32
|
+
[1m[35m (0.8ms)[0m BEGIN
|
33
|
+
[1m[36m (66.9ms)[0m [1mCREATE TABLE "foos" ("id" serial primary key, "foo" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
34
|
+
[1m[35m (0.4ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111024130334')
|
35
|
+
[1m[36m (15.0ms)[0m [1mCOMMIT[0m
|
36
|
+
Migrating to CreateBars (20111024130335)
|
37
|
+
[1m[35m (0.4ms)[0m BEGIN
|
38
|
+
[1m[36m (86.8ms)[0m [1mCREATE TABLE "bars" ("id" serial primary key, "bar" integer, "created_at" timestamp, "updated_at" timestamp) [0m
|
39
|
+
[1m[35m (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111024130335')
|
40
|
+
[1m[36m (9.6ms)[0m [1mCOMMIT[0m
|
41
|
+
[1m[35m (0.3ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
42
|
+
[1m[36m (0.4ms)[0m [1mSHOW search_path[0m
|
43
|
+
[1m[35m (2.2ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
44
|
+
FROM pg_class t
|
45
|
+
INNER JOIN pg_index d ON t.oid = d.indrelid
|
46
|
+
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
47
|
+
WHERE i.relkind = 'i'
|
48
|
+
AND d.indisprimary = 'f'
|
49
|
+
AND t.relname = 'bars'
|
50
|
+
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
51
|
+
ORDER BY i.relname
|
52
|
+
[1m[36m (1.0ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
53
|
+
FROM pg_class t
|
54
|
+
INNER JOIN pg_index d ON t.oid = d.indrelid
|
55
|
+
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
56
|
+
WHERE i.relkind = 'i'
|
57
|
+
AND d.indisprimary = 'f'
|
58
|
+
AND t.relname = 'foobars'
|
59
|
+
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
60
|
+
ORDER BY i.relname
|
61
|
+
[0m
|
62
|
+
[1m[35m (0.9ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
63
|
+
FROM pg_class t
|
64
|
+
INNER JOIN pg_index d ON t.oid = d.indrelid
|
65
|
+
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
66
|
+
WHERE i.relkind = 'i'
|
67
|
+
AND d.indisprimary = 'f'
|
68
|
+
AND t.relname = 'foos'
|
69
|
+
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
70
|
+
ORDER BY i.relname
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|