nostalgic 0.4.1 → 0.5.0
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 00d398b20013b379fec77c694e64fe4e39aadba34bd547a1a6b1b593178dca7a
|
4
|
+
data.tar.gz: aa181a9c2e257b7f06db912cb1216993138301f266c7500254488c869f540bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edb885d6afa764ccf104cc9a2f49fa20a76c265a169026ce445dfbb476b31881271ff8fd0ad5ce7d707ea350df2af0d7d1c73cc764210fe3fc47e6a389646e5a
|
7
|
+
data.tar.gz: 44f7f5ac5f1313a3c8ee8579215e1b6e618d2a68a3bddcc1a9aa4484a8272dd6321c151e4c2f7fe564ea1ce695f2194125731cff46b447301c15834e5652c11a
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Nostalgic
|
2
|
-
module
|
2
|
+
module NostalgicAttr
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
@@ -44,7 +44,7 @@ module Nostalgic
|
|
44
44
|
|
45
45
|
if scope.fetch(:nostalgic, false)
|
46
46
|
foreign_key = options.fetch(:foreign_key, "#{name}_id")
|
47
|
-
|
47
|
+
nostalgic_attr foreign_key
|
48
48
|
|
49
49
|
class_eval <<-METHODS, __FILE__, __LINE__ + 1
|
50
50
|
def #{name}_on(date)
|
@@ -58,7 +58,7 @@ module Nostalgic
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def nostalgic_attr(*attrs)
|
62
62
|
self.nostalgic_attrs ||= []
|
63
63
|
|
64
64
|
attrs.each do |attr|
|
data/lib/nostalgic/railtie.rb
CHANGED
data/lib/nostalgic/version.rb
CHANGED
Binary file
|
@@ -0,0 +1,162 @@
|
|
1
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "companies"[0m
|
2
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
3
|
+
[1m[35m (3.2ms)[0m [1m[35mCREATE TABLE "companies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
4
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "nostalgic_attrs"[0m
|
5
|
+
[1m[35m (1.7ms)[0m [1m[35mCREATE TABLE "nostalgic_attrs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "model_type" varchar NOT NULL, "model_id" integer NOT NULL, "name" varchar NOT NULL, "value" varchar, "effective_at" date NOT NULL, "created_at" datetime, "updated_at" datetime)[0m
|
6
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
7
|
+
[1m[35m (1.6ms)[0m [1m[35mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar NOT NULL, "tel" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "company_id" integer)[0m
|
8
|
+
[1m[35m (1.6ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
9
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
10
|
+
[1m[35m (1.7ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20161217105921)[0m
|
11
|
+
[1m[35m (1.6ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
12
|
+
(20160807103323),
|
13
|
+
(20161217105723);
|
14
|
+
|
15
|
+
[0m
|
16
|
+
[1m[35m (1.6ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
17
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
18
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
19
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "test"], ["created_at", "2018-03-08 14:00:42.517009"], ["updated_at", "2018-03-08 14:00:42.517009"]]
|
20
|
+
[1m[35m (1.5ms)[0m [1m[36mcommit transaction[0m
|
21
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
22
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
23
|
+
[1m[35m (0.0ms)[0m [1m[36mcommit transaction[0m
|
24
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
25
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
26
|
+
Migrating to CreateNostalgicAttrs (20160807101438)
|
27
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
28
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
29
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
30
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
31
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
32
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ?[0m [["key", "environment"]]
|
33
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "companies"[0m
|
34
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
35
|
+
[1m[35m (2.3ms)[0m [1m[35mCREATE TABLE "companies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
36
|
+
[1m[35m (0.2ms)[0m [1m[35mDROP TABLE IF EXISTS "nostalgic_attrs"[0m
|
37
|
+
[1m[35m (1.6ms)[0m [1m[35mCREATE TABLE "nostalgic_attrs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "model_type" varchar NOT NULL, "model_id" integer NOT NULL, "name" varchar NOT NULL, "value" varchar, "effective_at" date NOT NULL, "created_at" datetime, "updated_at" datetime)[0m
|
38
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
39
|
+
[1m[35m (1.7ms)[0m [1m[35mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar NOT NULL, "tel" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "company_id" integer)[0m
|
40
|
+
[1m[35m (1.5ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
41
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
42
|
+
[1m[35m (1.2ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20161217105921)[0m
|
43
|
+
[1m[35m (2.6ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
44
|
+
(20160807103323),
|
45
|
+
(20161217105723),
|
46
|
+
(20160807101438),
|
47
|
+
(20160816080815),
|
48
|
+
(20160816080822);
|
49
|
+
|
50
|
+
[0m
|
51
|
+
[1m[35m (3.0ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
52
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
53
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
54
|
+
[1m[35mSQL (0.2ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "test"], ["created_at", "2018-03-08 14:01:00.180684"], ["updated_at", "2018-03-08 14:01:00.180684"]]
|
55
|
+
[1m[35m (1.4ms)[0m [1m[36mcommit transaction[0m
|
56
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
57
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
58
|
+
[1m[35m (0.0ms)[0m [1m[36mcommit transaction[0m
|
59
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
60
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
61
|
+
[1m[35m (0.1ms)[0m [1m[35mPRAGMA foreign_keys[0m
|
62
|
+
[1m[35m (0.0ms)[0m [1m[35mPRAGMA foreign_keys = OFF[0m
|
63
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
64
|
+
[1m[36mFixture Delete (0.2ms)[0m [1m[31mDELETE FROM "companies"[0m
|
65
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "companies" ("id", "name", "created_at", "updated_at") VALUES (1, 'TestCompany001', '2018-03-08 14:01:05.322094', '2018-03-08 14:01:05.322094')[0m
|
66
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "companies" ("id", "name", "created_at", "updated_at") VALUES (2, 'TestCompany002', '2018-03-08 14:01:05.322094', '2018-03-08 14:01:05.322094')[0m
|
67
|
+
[1m[36mFixture Delete (0.1ms)[0m [1m[31mDELETE FROM "nostalgic_attrs"[0m
|
68
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (1, 'User', 1, 'tel', '111-123-4567', '2018-02-08', '2018-03-08 14:01:05.324387', '2018-03-08 14:01:05.324387')[0m
|
69
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (2, 'User', 1, 'tel', '222-123-4567', '2018-03-08', '2018-03-08 14:01:05.324387', '2018-03-08 14:01:05.324387')[0m
|
70
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (3, 'User', 1, 'tel', '333-123-4567', '2018-03-09', '2018-03-08 14:01:05.324387', '2018-03-08 14:01:05.324387')[0m
|
71
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (4, 'User', 1, 'company_id', '1', '2018-03-07', '2018-03-08 14:01:05.324387', '2018-03-08 14:01:05.324387')[0m
|
72
|
+
[1m[36mFixture Delete (0.1ms)[0m [1m[31mDELETE FROM "users"[0m
|
73
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "users" ("id", "company_id", "email", "tel", "created_at", "updated_at") VALUES (1, 1, 'test1@example.com', '222-123-4567', '2018-03-08 14:01:05.331515', '2018-03-08 14:01:05.331515')[0m
|
74
|
+
[1m[35m (1.9ms)[0m [1m[36mcommit transaction[0m
|
75
|
+
[1m[35m (0.1ms)[0m [1m[35mPRAGMA foreign_keys = 1[0m
|
76
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
77
|
+
-------------------------
|
78
|
+
UserTest: test_belongs_to
|
79
|
+
-------------------------
|
80
|
+
[1m[36mUser Load (0.2ms)[0m [1m[34mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
|
81
|
+
[1m[36mNostalgic::Attr Load (0.2ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "company_id"], ["LIMIT", 1]]
|
82
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"], ["LIMIT", 1]]
|
83
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["LIMIT", 1]]
|
84
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
85
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" ORDER BY "companies"."id" ASC LIMIT ? OFFSET ?[0m [["LIMIT", 1], ["OFFSET", 1]]
|
86
|
+
[1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
87
|
+
[1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "users" SET "company_id" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["company_id", 2], ["updated_at", "2018-03-08 14:01:05.358714"], ["id", 1]]
|
88
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["effective_at", "2018-03-09"], ["LIMIT", 1]]
|
89
|
+
[1m[35mSQL (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["value", "2"], ["effective_at", "2018-03-09"], ["created_at", "2018-03-08 14:01:05.360580"], ["updated_at", "2018-03-08 14:01:05.360580"]]
|
90
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2018-03-08"], ["LIMIT", 1]]
|
91
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
92
|
+
[1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
93
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "company_id"], ["LIMIT", 1]]
|
94
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"], ["LIMIT", 1]]
|
95
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
96
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-07') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["LIMIT", 1]]
|
97
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
98
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["LIMIT", 1]]
|
99
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
100
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-09') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["LIMIT", 1]]
|
101
|
+
[1m[36mCompany Load (0.1ms)[0m [1m[34mSELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
|
102
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
103
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
104
|
+
------------------
|
105
|
+
UserTest: test_tel
|
106
|
+
------------------
|
107
|
+
[1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
|
108
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "company_id"], ["LIMIT", 1]]
|
109
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"], ["LIMIT", 1]]
|
110
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-07') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
111
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
112
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-09') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
113
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
114
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
115
|
+
-----------------------
|
116
|
+
UserTest: test_save_tel
|
117
|
+
-----------------------
|
118
|
+
[1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
|
119
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "company_id"], ["LIMIT", 1]]
|
120
|
+
[1m[36mNostalgic::Attr Load (0.3ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"], ["LIMIT", 1]]
|
121
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
122
|
+
[1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
123
|
+
[1m[35mSQL (0.2ms)[0m [1m[33mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "444-123-4567"], ["updated_at", "2018-03-08 14:01:05.381445"], ["id", 1]]
|
124
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["effective_at", "2018-03-07"], ["LIMIT", 1]]
|
125
|
+
[1m[36mNostalgic::Attr Load (0.0ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2018-03-08"], ["LIMIT", 1]]
|
126
|
+
[1m[35mSQL (0.1ms)[0m [1m[33mUPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ?[0m [["value", "444-123-4567"], ["updated_at", "2018-03-08 14:01:05.383836"], ["id", 2]]
|
127
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
128
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
129
|
+
[1m[35m (0.0ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
130
|
+
[1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "555-123-4567"], ["updated_at", "2018-03-08 14:01:05.385645"], ["id", 1]]
|
131
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "company_id"], ["effective_at", "2018-03-07"], ["LIMIT", 1]]
|
132
|
+
[1m[36mNostalgic::Attr Load (0.0ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2018-03-10"], ["LIMIT", 1]]
|
133
|
+
[1m[35mSQL (0.1ms)[0m [1m[32mINSERT INTO "nostalgic_attrs" ("model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["value", "555-123-4567"], ["effective_at", "2018-03-10"], ["created_at", "2018-03-08 14:01:05.388194"], ["updated_at", "2018-03-08 14:01:05.388194"]]
|
134
|
+
[1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
135
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
136
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-09') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
137
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-10') ORDER BY effective_at desc LIMIT ?[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["LIMIT", 1]]
|
138
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
139
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
140
|
+
-------------------
|
141
|
+
UserTest: test_tels
|
142
|
+
-------------------
|
143
|
+
[1m[36mUser Load (0.1ms)[0m [1m[34mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?[0m [["LIMIT", 1]]
|
144
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "company_id"], ["LIMIT", 1]]
|
145
|
+
[1m[36mNostalgic::Attr Load (0.2ms)[0m [1m[34mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2018-03-08') ORDER BY effective_at desc LIMIT ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"], ["LIMIT", 1]]
|
146
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ?[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
147
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
148
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
149
|
+
--------------------------------------------
|
150
|
+
NostalgicTest: test_it_does_something_useful
|
151
|
+
--------------------------------------------
|
152
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
153
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
154
|
+
------------------------------------------------
|
155
|
+
NostalgicTest: test_that_it_has_a_version_number
|
156
|
+
------------------------------------------------
|
157
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
158
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
159
|
+
-----------------------------------------
|
160
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
161
|
+
-----------------------------------------
|
162
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nostalgic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -115,7 +115,7 @@ files:
|
|
115
115
|
- lib/nostalgic.rb
|
116
116
|
- lib/nostalgic/engine.rb
|
117
117
|
- lib/nostalgic/form_builder.rb
|
118
|
-
- lib/nostalgic/
|
118
|
+
- lib/nostalgic/nostalgic_attr.rb
|
119
119
|
- lib/nostalgic/railtie.rb
|
120
120
|
- lib/nostalgic/version.rb
|
121
121
|
- lib/tasks/nostalgic_tasks.rake
|
@@ -155,6 +155,8 @@ files:
|
|
155
155
|
- test/dummy/db/migrate/20161217105723_create_companies.rb
|
156
156
|
- test/dummy/db/migrate/20161217105921_add_column_company_id_on_users.rb
|
157
157
|
- test/dummy/db/schema.rb
|
158
|
+
- test/dummy/db/test.sqlite3
|
159
|
+
- test/dummy/log/test.log
|
158
160
|
- test/dummy/public/404.html
|
159
161
|
- test/dummy/public/422.html
|
160
162
|
- test/dummy/public/500.html
|
@@ -189,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
191
|
version: '0'
|
190
192
|
requirements: []
|
191
193
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.6
|
194
|
+
rubygems_version: 2.7.6
|
193
195
|
signing_key:
|
194
196
|
specification_version: 4
|
195
197
|
summary: column versioning utility
|
@@ -230,12 +232,14 @@ test_files:
|
|
230
232
|
- test/dummy/db/migrate/20161217105723_create_companies.rb
|
231
233
|
- test/dummy/db/migrate/20161217105921_add_column_company_id_on_users.rb
|
232
234
|
- test/dummy/db/schema.rb
|
235
|
+
- test/dummy/db/test.sqlite3
|
233
236
|
- test/dummy/public/404.html
|
234
237
|
- test/dummy/public/422.html
|
235
238
|
- test/dummy/public/500.html
|
236
239
|
- test/dummy/public/favicon.ico
|
237
240
|
- test/dummy/test/models/company_test.rb
|
238
241
|
- test/dummy/test/models/user_test.rb
|
242
|
+
- test/dummy/log/test.log
|
239
243
|
- test/fixtures/companies.yml
|
240
244
|
- test/fixtures/nostalgic/attrs.yml
|
241
245
|
- test/fixtures/users.yml
|