nostalgic 0.1.2 → 0.1.3
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 +11 -0
- data/lib/nostalgic/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +128 -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: b0f5c1b2d484ccbb20b2c5325c1d53919f9762f1
|
4
|
+
data.tar.gz: 2c619a38306ad3d63b9ea1ab1626c3162820c678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd93d1d171054652007844043c59997ee29eadad39e441adddacb35d5d7d1f77d5e918693fcc644a87eae0fcf06b951877365ed38a27b05d614600109bf35b63
|
7
|
+
data.tar.gz: 93369f9a9acc05533eff8c2f4d6147c98bc571815e6b70c7eee4426c0f91297c675cbab1f23fc8688fab4fd3d6d75907a31ca2abe663ec2ab8766393f01a4919
|
@@ -3,11 +3,22 @@ module Nostalgic
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
+
after_find :load_current_value
|
6
7
|
after_save :save_nostalgic_attrs!
|
7
8
|
end
|
8
9
|
|
9
10
|
private
|
10
11
|
|
12
|
+
def load_current_value
|
13
|
+
Array(self.class.nostalgic_attrs).each do |attr|
|
14
|
+
current = self.__send__(attr.to_s.pluralize).where('effective_at <= ?', Date.today).first
|
15
|
+
if current
|
16
|
+
self.__send__("#{attr}=", current.value)
|
17
|
+
self.__send__("#{attr}_effective_at=", current.effective_at)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
11
22
|
def save_nostalgic_attrs!
|
12
23
|
Array(self.class.nostalgic_attrs).each do |attr|
|
13
24
|
effective_at = self.__send__("#{attr}_effective_at")
|
data/lib/nostalgic/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -5733,3 +5733,131 @@ UserTest: test_tel
|
|
5733
5733
|
[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-19') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5734
5734
|
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5735
5735
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5736
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5737
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5738
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "nostalgic_attrs"[0m
|
5739
|
+
[1m[35mFixture Insert (0.1ms)[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-20', '2016-08-19 15:40:33', '2016-08-19 15:40:33')
|
5740
|
+
[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-20', '2016-08-19 15:40:33', '2016-08-19 15:40:33')[0m
|
5741
|
+
[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-21', '2016-08-19 15:40:33', '2016-08-19 15:40:33')
|
5742
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
5743
|
+
[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-19 15:40:33', '2016-08-19 15:40:33')
|
5744
|
+
[1m[36m (10.5ms)[0m [1mcommit transaction[0m
|
5745
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5746
|
+
-----------------------------------------
|
5747
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
5748
|
+
-----------------------------------------
|
5749
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5750
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5751
|
+
--------------------------------------------
|
5752
|
+
NostalgicTest: test_it_does_something_useful
|
5753
|
+
--------------------------------------------
|
5754
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5755
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5756
|
+
------------------------------------------------
|
5757
|
+
NostalgicTest: test_that_it_has_a_version_number
|
5758
|
+
------------------------------------------------
|
5759
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5760
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5761
|
+
-----------------------
|
5762
|
+
UserTest: test_save_tel
|
5763
|
+
-----------------------
|
5764
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5765
|
+
[1m[35mNostalgic::Attr Load (0.3ms)[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-20') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5766
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5767
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5768
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "444-123-4567"], ["updated_at", "2016-08-19 15:40:33.589982"], ["id", 1]]
|
5769
|
+
[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-20"]]
|
5770
|
+
[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-19 15:40:33.592648"], ["id", 2]]
|
5771
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5772
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5773
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5774
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ?[0m [["tel", "555-123-4567"], ["updated_at", "2016-08-19 15:40:33.594808"], ["id", 1]]
|
5775
|
+
[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-22"]]
|
5776
|
+
[1m[36mSQL (0.1ms)[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-22"], ["value", "555-123-4567"], ["created_at", "2016-08-19 15:40:33.596243"], ["updated_at", "2016-08-19 15:40:33.596243"]]
|
5777
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5778
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5779
|
+
[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"]]
|
5780
|
+
[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-22') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5781
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5782
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5783
|
+
------------------
|
5784
|
+
UserTest: test_tel
|
5785
|
+
------------------
|
5786
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
5787
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5788
|
+
[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-19') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5789
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5790
|
+
[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"]]
|
5791
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5792
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5793
|
+
-------------------
|
5794
|
+
UserTest: test_tels
|
5795
|
+
-------------------
|
5796
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5797
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5798
|
+
[1m[36m (0.1ms)[0m [1mSELECT 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"]]
|
5799
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5800
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5801
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5802
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "nostalgic_attrs"[0m
|
5803
|
+
[1m[35mFixture Insert (0.1ms)[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-20', '2016-08-19 15:47:52', '2016-08-19 15:47:52')
|
5804
|
+
[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-20', '2016-08-19 15:47:52', '2016-08-19 15:47:52')[0m
|
5805
|
+
[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-21', '2016-08-19 15:47:52', '2016-08-19 15:47:52')
|
5806
|
+
[1m[36mFixture Delete (0.0ms)[0m [1mDELETE FROM "users"[0m
|
5807
|
+
[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-19 15:47:52', '2016-08-19 15:47:52')
|
5808
|
+
[1m[36m (2.6ms)[0m [1mcommit transaction[0m
|
5809
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5810
|
+
------------------
|
5811
|
+
UserTest: test_tel
|
5812
|
+
------------------
|
5813
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5814
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5815
|
+
[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-19') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5816
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5817
|
+
[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-21') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5818
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5819
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5820
|
+
-----------------------
|
5821
|
+
UserTest: test_save_tel
|
5822
|
+
-----------------------
|
5823
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
|
5824
|
+
[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-20') ORDER BY effective_at desc LIMIT 1[0m [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5825
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5826
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5827
|
+
[1m[35mSQL (0.3ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "444-123-4567"], ["updated_at", "2016-08-19 15:47:52.864197"], ["id", 1]]
|
5828
|
+
[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 "nostalgic_attrs"."effective_at" = ? ORDER BY "nostalgic_attrs"."id" ASC LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-20"]]
|
5829
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ? [["value", "444-123-4567"], ["updated_at", "2016-08-19 15:47:52.867387"], ["id", 2]]
|
5830
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5831
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5832
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5833
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "555-123-4567"], ["updated_at", "2016-08-19 15:47:52.869328"], ["id", 1]]
|
5834
|
+
[1m[36mNostalgic::Attr Load (0.0ms)[0m [1mSELECT "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[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-22"]]
|
5835
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "nostalgic_attrs" ("model_type", "model_id", "name", "effective_at", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["model_type", "User"], ["model_id", 1], ["name", "tel"], ["effective_at", "2016-08-22"], ["value", "555-123-4567"], ["created_at", "2016-08-19 15:47:52.874378"], ["updated_at", "2016-08-19 15:47:52.874378"]]
|
5836
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5837
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5838
|
+
[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-21') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5839
|
+
[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-22') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5840
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5841
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5842
|
+
-------------------
|
5843
|
+
UserTest: test_tels
|
5844
|
+
-------------------
|
5845
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5846
|
+
[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-20') ORDER BY effective_at desc LIMIT 1 [["model_id", 1], ["model_type", "User"], ["name", "tel"]]
|
5847
|
+
[1m[36m (0.1ms)[0m [1mSELECT 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"]]
|
5848
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5849
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5850
|
+
-----------------------------------------
|
5851
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
5852
|
+
-----------------------------------------
|
5853
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5854
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5855
|
+
--------------------------------------------
|
5856
|
+
NostalgicTest: test_it_does_something_useful
|
5857
|
+
--------------------------------------------
|
5858
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5859
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5860
|
+
------------------------------------------------
|
5861
|
+
NostalgicTest: test_that_it_has_a_version_number
|
5862
|
+
------------------------------------------------
|
5863
|
+
[1m[35m (0.1ms)[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.3
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|