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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e369bdb07b7381f2011b5215a9c034e01b2db5c
4
- data.tar.gz: cd59987cce8bf4327155410a4c70260e63ea5785
3
+ metadata.gz: 41ba1813bd79157148bad190413115f0bc853745
4
+ data.tar.gz: 3cdfc14b2e871f2c7c14f63fc75760d33ecec056
5
5
  SHA512:
6
- metadata.gz: ca4b6783b2dc9bfffcf505e61d5cd9a81d3a20b3cdb46dd58f78c50e295d974837161a7510be43c3558727a46495885a79c959c5cbd13a3460b32ad0cbae1b23
7
- data.tar.gz: b66bb93d99a49054d6c4a92312b81cfcad28a0f11905d1d4849b98b080c7d82a2f2ac3e0a119e7246fc46a210a32bb86a3560c4791539b03a376507f04aef1cc
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
@@ -1,3 +1,3 @@
1
1
  module Nostalgic
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
Binary file
@@ -5925,3 +5925,67 @@ UserTest: test_save_tel
5925
5925
  Nostalgic::Attr Load (0.1ms) 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
  Nostalgic::Attr Load (0.2ms) 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"]]
5927
5927
   (0.2ms) rollback transaction
5928
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5929
+  (0.2ms) begin transaction
5930
+ Fixture Delete (0.4ms) DELETE FROM "nostalgic_attrs"
5931
+ Fixture Insert (0.2ms) 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
+ Fixture Insert (0.1ms) INSERT 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')
5933
+ Fixture Insert (0.0ms) 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
+ Fixture Delete (0.1ms) DELETE FROM "users"
5935
+ Fixture Insert (0.1ms) 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
+  (1.8ms) commit transaction
5937
+  (0.1ms) begin transaction
5938
+ -----------------------------------------
5939
+ Nostalgic::AttrTest: test_nostalgic_model
5940
+ -----------------------------------------
5941
+  (0.1ms) rollback transaction
5942
+  (0.0ms) begin transaction
5943
+ ------------------
5944
+ UserTest: test_tel
5945
+ ------------------
5946
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5947
+ Nostalgic::Attr Load (0.2ms) 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
+ Nostalgic::Attr Load (0.1ms) 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-27') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5949
+ Nostalgic::Attr Load (0.1ms) 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
+ Nostalgic::Attr Load (0.1ms) 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"]]
5951
+  (0.1ms) rollback transaction
5952
+  (0.0ms) begin transaction
5953
+ -------------------
5954
+ UserTest: test_tels
5955
+ -------------------
5956
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5957
+ Nostalgic::Attr Load (0.1ms) 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"]]
5958
+  (0.1ms) 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
+  (0.0ms) rollback transaction
5960
+  (0.0ms) begin transaction
5961
+ -----------------------
5962
+ UserTest: test_save_tel
5963
+ -----------------------
5964
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5965
+ Nostalgic::Attr Load (0.1ms) 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
+ Nostalgic::Attr Load (0.1ms) 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"]]
5967
+  (0.0ms) SAVEPOINT active_record_1
5968
+ SQL (0.2ms) UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "444-123-4567"], ["updated_at", "2016-08-28 02:50:45.089433"], ["id", 1]]
5969
+ Nostalgic::Attr Load (0.1ms) 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
+ SQL (0.1ms) UPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ? [["value", "444-123-4567"], ["updated_at", "2016-08-28 02:50:45.092137"], ["id", 2]]
5971
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5972
+ Nostalgic::Attr Load (0.1ms) 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"]]
5973
+  (0.0ms) SAVEPOINT active_record_1
5974
+ SQL (0.1ms) UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "555-123-4567"], ["updated_at", "2016-08-28 02:50:45.094310"], ["id", 1]]
5975
+ Nostalgic::Attr Load (0.0ms) 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
+ SQL (0.2ms) 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-30"], ["value", "555-123-4567"], ["created_at", "2016-08-28 02:50:45.095842"], ["updated_at", "2016-08-28 02:50:45.095842"]]
5977
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5978
+ Nostalgic::Attr Load (0.1ms) 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"]]
5979
+ Nostalgic::Attr Load (0.1ms) 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
+ Nostalgic::Attr Load (0.2ms) 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-30') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5981
+  (0.2ms) rollback transaction
5982
+  (0.1ms) begin transaction
5983
+ ------------------------------------------------
5984
+ NostalgicTest: test_that_it_has_a_version_number
5985
+ ------------------------------------------------
5986
+  (0.0ms) rollback transaction
5987
+  (0.0ms) begin transaction
5988
+ --------------------------------------------
5989
+ NostalgicTest: test_it_does_something_useful
5990
+ --------------------------------------------
5991
+  (0.0ms) 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.5
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-20 00:00:00.000000000 Z
11
+ date: 2016-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails