nostalgic 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nostalgic/nostalgic_for.rb +4 -0
- data/lib/nostalgic/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +64 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41ba1813bd79157148bad190413115f0bc853745
|
4
|
+
data.tar.gz: 3cdfc14b2e871f2c7c14f63fc75760d33ecec056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af92321ab32f034f74aa6025c6df8426e407296fb90241456c7787793bb793ade5c66bf2e87cc0e99f0e435f9d417d5bc99c2c69a261987c0b162ac4a5edfdfc
|
7
|
+
data.tar.gz: 06db584fdec446cdab5632eae2c72a662f3b0896e40c02ccf14b320b3f4ac8f4bfceb50cdf6c782b8060086808be103d1f9108183d20d7028d500b1f349b98b6
|
@@ -15,6 +15,10 @@ module Nostalgic
|
|
15
15
|
if current
|
16
16
|
self.__send__("#{attr}=", current.value)
|
17
17
|
self.__send__("#{attr}_effective_at=", current.effective_at)
|
18
|
+
else
|
19
|
+
if self.respond_to?(:created_at) and self.created_at.present?
|
20
|
+
self.__send__("#{attr}_effective_at=", self.created_at.to_date)
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
data/lib/nostalgic/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -5925,3 +5925,67 @@ UserTest: test_save_tel
|
|
5925
5925
|
[1m[35mNostalgic::Attr Load (0.1ms)[0m SELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-21') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5926
5926
|
[1m[36mNostalgic::Attr Load (0.2ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-22') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5927
5927
|
[1m[35m (0.2ms)[0m rollback transaction
|
5928
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5929
|
+
[1m[35m (0.2ms)[0m begin transaction
|
5930
|
+
[1m[36mFixture Delete (0.4ms)[0m [1mDELETE FROM "nostalgic_attrs"[0m
|
5931
|
+
[1m[35mFixture Insert (0.2ms)[0m INSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (1, 'User', 1, 'tel', '111-123-4567', '2016-07-28', '2016-08-28 02:50:45', '2016-08-28 02:50:45')
|
5932
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (2, 'User', 1, 'tel', '222-123-4567', '2016-08-28', '2016-08-28 02:50:45', '2016-08-28 02:50:45')[0m
|
5933
|
+
[1m[35mFixture Insert (0.0ms)[0m INSERT INTO "nostalgic_attrs" ("id", "model_type", "model_id", "name", "value", "effective_at", "created_at", "updated_at") VALUES (3, 'User', 1, 'tel', '333-123-4567', '2016-08-29', '2016-08-28 02:50:45', '2016-08-28 02:50:45')
|
5934
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
5935
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "users" ("id", "email", "tel", "created_at", "updated_at") VALUES (1, 'test1@example.com', '222-123-4567', '2016-08-28 02:50:45', '2016-08-28 02:50:45')
|
5936
|
+
[1m[36m (1.8ms)[0m [1mcommit transaction[0m
|
5937
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5938
|
+
-----------------------------------------
|
5939
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
5940
|
+
-----------------------------------------
|
5941
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5942
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5943
|
+
------------------
|
5944
|
+
UserTest: test_tel
|
5945
|
+
------------------
|
5946
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5947
|
+
[1m[35mNostalgic::Attr Load (0.2ms)[0m SELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5948
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-27') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5949
|
+
[1m[35mNostalgic::Attr Load (0.1ms)[0m SELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5950
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-29') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5951
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5952
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5953
|
+
-------------------
|
5954
|
+
UserTest: test_tels
|
5955
|
+
-------------------
|
5956
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
5957
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5958
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5959
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5960
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5961
|
+
-----------------------
|
5962
|
+
UserTest: test_save_tel
|
5963
|
+
-----------------------
|
5964
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5965
|
+
[1m[35mNostalgic::Attr Load (0.1ms)[0m SELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5966
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5967
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5968
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "444-123-4567"], ["updated_at", "2016-08-28 02:50:45.089433"], ["id", 1]]
|
5969
|
+
[1m[35mNostalgic::Attr Load (0.1ms)[0m SELECT "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 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-28"]]
|
5970
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ?[0m [["value", "444-123-4567"], ["updated_at", "2016-08-28 02:50:45.092137"], ["id", 2]]
|
5971
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5972
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5973
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5974
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "555-123-4567"], ["updated_at", "2016-08-28 02:50:45.094310"], ["id", 1]]
|
5975
|
+
[1m[35mNostalgic::Attr Load (0.0ms)[0m SELECT "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 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-30"]]
|
5976
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "nostalgic_attrs" ("model_type", "model_id", "name", "effective_at", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-30"], ["value", "555-123-4567"], ["created_at", "2016-08-28 02:50:45.095842"], ["updated_at", "2016-08-28 02:50:45.095842"]]
|
5977
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5978
|
+
[1m[36mNostalgic::Attr Load (0.1ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-28') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5979
|
+
[1m[35mNostalgic::Attr Load (0.1ms)[0m SELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-29') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5980
|
+
[1m[36mNostalgic::Attr Load (0.2ms)[0m [1mSELECT "nostalgic_attrs".* FROM "nostalgic_attrs" WHERE "nostalgic_attrs"."model_type" = ? AND "nostalgic_attrs"."model_id" = ? AND "nostalgic_attrs"."name" = ? AND (effective_at <= '2016-08-30') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5981
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
5982
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5983
|
+
------------------------------------------------
|
5984
|
+
NostalgicTest: test_that_it_has_a_version_number
|
5985
|
+
------------------------------------------------
|
5986
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5987
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5988
|
+
--------------------------------------------
|
5989
|
+
NostalgicTest: test_it_does_something_useful
|
5990
|
+
--------------------------------------------
|
5991
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
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.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|