nostalgic 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/migrate/20160816080815_change_column_created_at_on_nostalgic_attrs.rb +8 -0
- data/db/migrate/20160816080822_change_column_updated_at_on_nostalgic_attrs.rb +8 -0
- data/lib/nostalgic/nostalgic_for.rb +1 -1
- data/lib/nostalgic/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +3 -3
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +75 -0
- data/test/dummy/log/test.log +132 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 792170ed5f2a841df88e8fb0929bd5121f50de6a
|
4
|
+
data.tar.gz: 0435867587829630542c928cd00049ee70c9ece6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0f1603ba599440ee7bcac2aa93865923b9d37ed016bd369510998c5be88159d8b4785636d3a65256036feb362d21c1cbb8173d8b1ffbf2d319be9a3600a934
|
7
|
+
data.tar.gz: 5052f45bc4771b845804b0694a09cc00c4fbfdd58ad2e7ed9d595b292806c12ce2f605a429f476c321673da9cb8a4b897a167c05e559b91fe054810e81fe92ae
|
@@ -33,7 +33,7 @@ module Nostalgic
|
|
33
33
|
model_name = self.model_name.to_s
|
34
34
|
|
35
35
|
class_eval <<-METHODS, __FILE__, __LINE__ + 1
|
36
|
-
has_many :#{attr.to_s.pluralize}, -> {where(:model_type => model_name, :name => '#{attr}')}, :class_name => 'Nostalgic::Attr', :foreign_key => 'model_id'
|
36
|
+
has_many :#{attr.to_s.pluralize}, -> {where(:model_type => model_name, :name => '#{attr}').order('effective_at desc')}, :class_name => 'Nostalgic::Attr', :foreign_key => 'model_id'
|
37
37
|
accepts_nested_attributes_for :#{attr.to_s.pluralize}, :allow_destroy => true
|
38
38
|
|
39
39
|
attr_accessor :#{attr}_effective_at
|
data/lib/nostalgic/version.rb
CHANGED
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160816080822) do
|
15
15
|
|
16
16
|
create_table "nostalgic_attrs", force: :cascade do |t|
|
17
17
|
t.string "model_type", null: false
|
@@ -19,8 +19,8 @@ ActiveRecord::Schema.define(version: 20160807103323) do
|
|
19
19
|
t.string "name", null: false
|
20
20
|
t.string "value"
|
21
21
|
t.date "effective_at", null: false
|
22
|
-
t.datetime "created_at"
|
23
|
-
t.datetime "updated_at"
|
22
|
+
t.datetime "created_at"
|
23
|
+
t.datetime "updated_at"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "users", force: :cascade do |t|
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -484,3 +484,78 @@ Migrating to RenameColumnModelTypeToModelNameOnNostalgicAttrs (20160813041333)
|
|
484
484
|
[1m[36m (1.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160807103323')[0m
|
485
485
|
[1m[35m (1.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160807101438')
|
486
486
|
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
487
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
488
|
+
Migrating to ChangeColumnCreatedAtOnNostalgicAttrs (20160816080815)
|
489
|
+
[1m[35m (0.1ms)[0m begin transaction
|
490
|
+
[1m[36m (0.6ms)[0m [1mCREATE TEMPORARY TABLE "anostalgic_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 NOT NULL, "updated_at" datetime NOT NULL) [0m
|
491
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "nostalgic_attrs"
|
492
|
+
[1m[36m (0.1ms)[0m [1mDROP TABLE "nostalgic_attrs"[0m
|
493
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
494
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
495
|
+
Migrating to ChangeColumnCreatedAtOnNostalgicAttrs (20160816080815)
|
496
|
+
[1m[35m (0.1ms)[0m begin transaction
|
497
|
+
[1m[36m (0.5ms)[0m [1mCREATE TEMPORARY TABLE "anostalgic_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 NOT NULL, "updated_at" datetime NOT NULL) [0m
|
498
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "nostalgic_attrs"
|
499
|
+
[1m[36m (0.2ms)[0m [1mDROP TABLE "nostalgic_attrs"[0m
|
500
|
+
[1m[35m (0.2ms)[0m CREATE 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 NOT NULL)
|
501
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "anostalgic_attrs"[0m
|
502
|
+
[1m[35m (0.1ms)[0m DROP TABLE "anostalgic_attrs"
|
503
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160816080815"]]
|
504
|
+
[1m[35m (3.1ms)[0m commit transaction
|
505
|
+
Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
|
506
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
507
|
+
[1m[35m (0.1ms)[0m CREATE TEMPORARY TABLE "anostalgic_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 NOT NULL)
|
508
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "nostalgic_attrs"[0m
|
509
|
+
[1m[35m (0.1ms)[0m DROP TABLE "nostalgic_attrs"
|
510
|
+
[1m[36m (0.1ms)[0m [1mCREATE 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
|
511
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "anostalgic_attrs"
|
512
|
+
[1m[36m (0.1ms)[0m [1mDROP TABLE "anostalgic_attrs"[0m
|
513
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160816080822"]]
|
514
|
+
[1m[36m (2.0ms)[0m [1mcommit transaction[0m
|
515
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
516
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
517
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
518
|
+
Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
|
519
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
520
|
+
[1m[35m (0.4ms)[0m CREATE TEMPORARY TABLE "anostalgic_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)
|
521
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "nostalgic_attrs"[0m
|
522
|
+
[1m[35m (0.1ms)[0m DROP TABLE "nostalgic_attrs"
|
523
|
+
[1m[36m (0.1ms)[0m [1mCREATE 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 NOT NULL) [0m
|
524
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "anostalgic_attrs"
|
525
|
+
[1m[36m (0.1ms)[0m [1mDROP TABLE "anostalgic_attrs"[0m
|
526
|
+
[1m[35mSQL (0.1ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20160816080822"]]
|
527
|
+
[1m[36m (3.1ms)[0m [1mcommit transaction[0m
|
528
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
529
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
530
|
+
Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
|
531
|
+
[1m[35m (0.0ms)[0m begin transaction
|
532
|
+
[1m[36m (0.1ms)[0m [1mCREATE TEMPORARY TABLE "anostalgic_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 NOT NULL) [0m
|
533
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "nostalgic_attrs"
|
534
|
+
[1m[36m (0.1ms)[0m [1mDROP TABLE "nostalgic_attrs"[0m
|
535
|
+
[1m[35m (0.1ms)[0m CREATE 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)
|
536
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "anostalgic_attrs"[0m
|
537
|
+
[1m[35m (0.1ms)[0m DROP TABLE "anostalgic_attrs"
|
538
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160816080822"]]
|
539
|
+
[1m[35m (1.9ms)[0m commit transaction
|
540
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
541
|
+
[1m[36m (3.0ms)[0m [1mCREATE 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
|
542
|
+
[1m[35m (1.9ms)[0m CREATE 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)
|
543
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
544
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
545
|
+
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
546
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
547
|
+
[1m[36m (2.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160816080822')[0m
|
548
|
+
[1m[35m (1.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
|
549
|
+
[1m[36m (1.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160807101438')[0m
|
550
|
+
[1m[35m (1.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160816080815')
|
551
|
+
[1m[36m (1.4ms)[0m [1mCREATE 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
|
552
|
+
[1m[35m (1.4ms)[0m CREATE 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)
|
553
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
554
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
555
|
+
[1m[36m (1.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
556
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
557
|
+
[1m[36m (1.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160816080822')[0m
|
558
|
+
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
|
559
|
+
[1m[36m (1.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160807101438')[0m
|
560
|
+
[1m[35m (1.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160816080815')
|
561
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
data/test/dummy/log/test.log
CHANGED
@@ -5601,3 +5601,135 @@ NostalgicTest: test_that_it_has_a_version_number
|
|
5601
5601
|
Nostalgic::AttrTest: test_nostalgic_model
|
5602
5602
|
-----------------------------------------
|
5603
5603
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5604
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5605
|
+
[1m[36m (3.3ms)[0m [1mCREATE 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
|
5606
|
+
[1m[35m (1.9ms)[0m CREATE 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)
|
5607
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
5608
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
5609
|
+
[1m[36m (1.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
5610
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
5611
|
+
[1m[36m (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160816080822')[0m
|
5612
|
+
[1m[35m (1.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
|
5613
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5614
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5615
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5616
|
+
[1m[36mFixture Delete (0.6ms)[0m [1mDELETE FROM "nostalgic_attrs"[0m
|
5617
|
+
[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-16', '2016-08-16 08:10:35', '2016-08-16 08:10:35')
|
5618
|
+
[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-16', '2016-08-16 08:10:35', '2016-08-16 08:10:35')[0m
|
5619
|
+
[1m[35mFixture Insert (0.1ms)[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-17', '2016-08-16 08:10:35', '2016-08-16 08:10:35')
|
5620
|
+
[1m[36mFixture Delete (0.0ms)[0m [1mDELETE FROM "users"[0m
|
5621
|
+
[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-16 08:10:35', '2016-08-16 08:10:35')
|
5622
|
+
[1m[36m (3.0ms)[0m [1mcommit transaction[0m
|
5623
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5624
|
+
-----------------------------------------
|
5625
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
5626
|
+
-----------------------------------------
|
5627
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5628
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5629
|
+
------------------
|
5630
|
+
UserTest: test_tel
|
5631
|
+
------------------
|
5632
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5633
|
+
[1m[35mNostalgic::Attr Load (0.2ms)[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-15') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5634
|
+
[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-16') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5635
|
+
[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-17') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5636
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5637
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5638
|
+
-------------------
|
5639
|
+
UserTest: test_tels
|
5640
|
+
-------------------
|
5641
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5642
|
+
[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"]]
|
5643
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5644
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5645
|
+
-----------------------
|
5646
|
+
UserTest: test_save_tel
|
5647
|
+
-----------------------
|
5648
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5649
|
+
[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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5650
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5651
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "444-123-4567"], ["updated_at", "2016-08-16 08:10:35.766556"], ["id", 1]]
|
5652
|
+
[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-16"]]
|
5653
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ? [["value", "444-123-4567"], ["updated_at", "2016-08-16 08:10:35.768779"], ["id", 2]]
|
5654
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5655
|
+
[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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5656
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5657
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "555-123-4567"], ["updated_at", "2016-08-16 08:10:35.770709"], ["id", 1]]
|
5658
|
+
[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-18"]]
|
5659
|
+
[1m[35mSQL (0.2ms)[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-18"], ["value", "555-123-4567"], ["created_at", "2016-08-16 08:10:35.772597"], ["updated_at", "2016-08-16 08:10:35.772597"]]
|
5660
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5661
|
+
[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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5662
|
+
[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-17') ORDER BY effective_at desc LIMIT 1[0m [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5663
|
+
[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-18') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
5664
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5665
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5666
|
+
--------------------------------------------
|
5667
|
+
NostalgicTest: test_it_does_something_useful
|
5668
|
+
--------------------------------------------
|
5669
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5670
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5671
|
+
------------------------------------------------
|
5672
|
+
NostalgicTest: test_that_it_has_a_version_number
|
5673
|
+
------------------------------------------------
|
5674
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5675
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5676
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5677
|
+
[1m[36mFixture Delete (1.4ms)[0m [1mDELETE FROM "nostalgic_attrs"[0m
|
5678
|
+
[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-19', '2016-08-18 23:31:41', '2016-08-18 23:31:41')
|
5679
|
+
[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-19', '2016-08-18 23:31:41', '2016-08-18 23:31:41')[0m
|
5680
|
+
[1m[35mFixture Insert (0.1ms)[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-20', '2016-08-18 23:31:41', '2016-08-18 23:31:41')
|
5681
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "users"[0m
|
5682
|
+
[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-18 23:31:41', '2016-08-18 23:31:41')
|
5683
|
+
[1m[36m (1.6ms)[0m [1mcommit transaction[0m
|
5684
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5685
|
+
-----------------------------------------
|
5686
|
+
Nostalgic::AttrTest: test_nostalgic_model
|
5687
|
+
-----------------------------------------
|
5688
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5689
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5690
|
+
--------------------------------------------
|
5691
|
+
NostalgicTest: test_it_does_something_useful
|
5692
|
+
--------------------------------------------
|
5693
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5694
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5695
|
+
------------------------------------------------
|
5696
|
+
NostalgicTest: test_that_it_has_a_version_number
|
5697
|
+
------------------------------------------------
|
5698
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
5699
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5700
|
+
-------------------
|
5701
|
+
UserTest: test_tels
|
5702
|
+
-------------------
|
5703
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5704
|
+
[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"]]
|
5705
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5706
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5707
|
+
-----------------------
|
5708
|
+
UserTest: test_save_tel
|
5709
|
+
-----------------------
|
5710
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5711
|
+
[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"]]
|
5712
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5713
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "444-123-4567"], ["updated_at", "2016-08-18 23:31:41.578721"], ["id", 1]]
|
5714
|
+
[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-19"]]
|
5715
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "nostalgic_attrs" SET "value" = ?, "updated_at" = ? WHERE "nostalgic_attrs"."id" = ? [["value", "444-123-4567"], ["updated_at", "2016-08-18 23:31:41.581389"], ["id", 2]]
|
5716
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5717
|
+
[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"]]
|
5718
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5719
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "users" SET "tel" = ?, "updated_at" = ? WHERE "users"."id" = ? [["tel", "555-123-4567"], ["updated_at", "2016-08-18 23:31:41.584534"], ["id", 1]]
|
5720
|
+
[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-21"]]
|
5721
|
+
[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-21"], ["value", "555-123-4567"], ["created_at", "2016-08-18 23:31:41.586314"], ["updated_at", "2016-08-18 23:31:41.586314"]]
|
5722
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5723
|
+
[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"]]
|
5724
|
+
[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"]]
|
5725
|
+
[1m[35mNostalgic::Attr Load (0.2ms)[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"]]
|
5726
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
5727
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5728
|
+
------------------
|
5729
|
+
UserTest: test_tel
|
5730
|
+
------------------
|
5731
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
5732
|
+
[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-18') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
|
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
|
+
[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
|
+
[1m[36m (0.1ms)[0m [1mrollback 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.1.
|
4
|
+
version: 0.1.2
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -103,6 +103,8 @@ files:
|
|
103
103
|
- app/views/layouts/nostalgic/application.html.erb
|
104
104
|
- config/routes.rb
|
105
105
|
- db/migrate/20160807101438_create_nostalgic_attrs.rb
|
106
|
+
- db/migrate/20160816080815_change_column_created_at_on_nostalgic_attrs.rb
|
107
|
+
- db/migrate/20160816080822_change_column_updated_at_on_nostalgic_attrs.rb
|
106
108
|
- lib/nostalgic.rb
|
107
109
|
- lib/nostalgic/engine.rb
|
108
110
|
- lib/nostalgic/form_builder.rb
|