nostalgic 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b326eaf450ddc4d7e984d8e386819b64ca7346b9
4
- data.tar.gz: 0d408fd2403e2bf3694820deaf2e96126d25bf2c
3
+ metadata.gz: 792170ed5f2a841df88e8fb0929bd5121f50de6a
4
+ data.tar.gz: 0435867587829630542c928cd00049ee70c9ece6
5
5
  SHA512:
6
- metadata.gz: b79e8dd7f6bf4f7d73e8d7e1214095d532cc6e9d379941033c90f6909dcb0adc5fcbcfb841252f9d6a6b05d61d8da230cb9b989fb19e3314131f0157ba84ca9d
7
- data.tar.gz: 2977f894153b77c016b03a30763cd968fae58d99dc9234f5f2033768ee1b059ece3955bedf7721f85ee3ddb2aba7308c48ae439df6b5e376a07d1d41f13b61fb
6
+ metadata.gz: 7d0f1603ba599440ee7bcac2aa93865923b9d37ed016bd369510998c5be88159d8b4785636d3a65256036feb362d21c1cbb8173d8b1ffbf2d319be9a3600a934
7
+ data.tar.gz: 5052f45bc4771b845804b0694a09cc00c4fbfdd58ad2e7ed9d595b292806c12ce2f605a429f476c321673da9cb8a4b897a167c05e559b91fe054810e81fe92ae
@@ -0,0 +1,8 @@
1
+ class ChangeColumnCreatedAtOnNostalgicAttrs < ActiveRecord::Migration
2
+ def up
3
+ change_column :nostalgic_attrs, :created_at, :datetime, :null => true
4
+ end
5
+ def down
6
+ change_column :nostalgic_attrs, :created_at, :datetime, :null => false
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class ChangeColumnUpdatedAtOnNostalgicAttrs < ActiveRecord::Migration
2
+ def up
3
+ change_column :nostalgic_attrs, :updated_at, :datetime, :null => true
4
+ end
5
+ def down
6
+ change_column :nostalgic_attrs, :updated_at, :datetime, :null => false
7
+ end
8
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Nostalgic
2
- VERSION = "0.1.1"
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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: 20160807103323) do
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", null: false
23
- t.datetime "updated_at", null: false
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
24
  end
25
25
 
26
26
  create_table "users", force: :cascade do |t|
Binary file
@@ -484,3 +484,78 @@ Migrating to RenameColumnModelTypeToModelNameOnNostalgicAttrs (20160813041333)
484
484
   (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
485
485
   (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807101438')
486
486
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
487
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
488
+ Migrating to ChangeColumnCreatedAtOnNostalgicAttrs (20160816080815)
489
+  (0.1ms) begin transaction
490
+  (0.6ms) 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 NOT NULL, "updated_at" datetime NOT NULL) 
491
+  (0.0ms) SELECT * FROM "nostalgic_attrs"
492
+  (0.1ms) DROP TABLE "nostalgic_attrs"
493
+  (0.1ms) rollback transaction
494
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
495
+ Migrating to ChangeColumnCreatedAtOnNostalgicAttrs (20160816080815)
496
+  (0.1ms) begin transaction
497
+  (0.5ms) 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 NOT NULL, "updated_at" datetime NOT NULL) 
498
+  (0.0ms) SELECT * FROM "nostalgic_attrs"
499
+  (0.2ms) DROP TABLE "nostalgic_attrs"
500
+  (0.2ms) 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
+  (0.0ms) SELECT * FROM "anostalgic_attrs"
502
+  (0.1ms) DROP TABLE "anostalgic_attrs"
503
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160816080815"]]
504
+  (3.1ms) commit transaction
505
+ Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
506
+  (0.1ms) begin transaction
507
+  (0.1ms) 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
+  (0.0ms) SELECT * FROM "nostalgic_attrs"
509
+  (0.1ms) DROP TABLE "nostalgic_attrs"
510
+  (0.1ms) 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) 
511
+  (0.0ms) SELECT * FROM "anostalgic_attrs"
512
+  (0.1ms) DROP TABLE "anostalgic_attrs"
513
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160816080822"]]
514
+  (2.0ms) commit transaction
515
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
516
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
517
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
518
+ Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
519
+  (0.0ms) begin transaction
520
+  (0.4ms) 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
+  (0.0ms) SELECT * FROM "nostalgic_attrs"
522
+  (0.1ms) DROP TABLE "nostalgic_attrs"
523
+  (0.1ms) 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) 
524
+  (0.0ms) SELECT * FROM "anostalgic_attrs"
525
+  (0.1ms) DROP TABLE "anostalgic_attrs"
526
+ SQL (0.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20160816080822"]]
527
+  (3.1ms) commit transaction
528
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
529
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
530
+ Migrating to ChangeColumnUpdatedAtOnNostalgicAttrs (20160816080822)
531
+  (0.0ms) begin transaction
532
+  (0.1ms) 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) 
533
+  (0.0ms) SELECT * FROM "nostalgic_attrs"
534
+  (0.1ms) DROP TABLE "nostalgic_attrs"
535
+  (0.1ms) 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
+  (0.0ms) SELECT * FROM "anostalgic_attrs"
537
+  (0.1ms) DROP TABLE "anostalgic_attrs"
538
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160816080822"]]
539
+  (1.9ms) commit transaction
540
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
541
+  (3.0ms) 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) 
542
+  (1.9ms) 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
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
544
+  (0.1ms) select sqlite_version(*)
545
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
546
+  (0.1ms) SELECT version FROM "schema_migrations"
547
+  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20160816080822')
548
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
549
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807101438')
550
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20160816080815')
551
+  (1.4ms) 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) 
552
+  (1.4ms) 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
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
554
+  (0.1ms) select sqlite_version(*)
555
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
556
+  (0.1ms) SELECT version FROM "schema_migrations"
557
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160816080822')
558
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
559
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807101438')
560
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20160816080815')
561
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -5601,3 +5601,135 @@ NostalgicTest: test_that_it_has_a_version_number
5601
5601
  Nostalgic::AttrTest: test_nostalgic_model
5602
5602
  -----------------------------------------
5603
5603
   (0.0ms) rollback transaction
5604
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5605
+  (3.3ms) 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) 
5606
+  (1.9ms) 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
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
5608
+  (0.1ms) select sqlite_version(*)
5609
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5610
+  (0.1ms) SELECT version FROM "schema_migrations"
5611
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20160816080822')
5612
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160807103323')
5613
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5614
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5615
+  (0.1ms) begin transaction
5616
+ Fixture Delete (0.6ms) DELETE FROM "nostalgic_attrs"
5617
+ Fixture Insert (0.1ms) 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
+ 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-16', '2016-08-16 08:10:35', '2016-08-16 08:10:35')
5619
+ Fixture Insert (0.1ms) 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
+ Fixture Delete (0.0ms) DELETE FROM "users"
5621
+ Fixture Insert (0.1ms) 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
+  (3.0ms) commit transaction
5623
+  (0.0ms) begin transaction
5624
+ -----------------------------------------
5625
+ Nostalgic::AttrTest: test_nostalgic_model
5626
+ -----------------------------------------
5627
+  (0.1ms) rollback transaction
5628
+  (0.0ms) begin transaction
5629
+ ------------------
5630
+ UserTest: test_tel
5631
+ ------------------
5632
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5633
+ 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-15') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5634
+ 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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5635
+ 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-17') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5636
+  (0.0ms) rollback transaction
5637
+  (0.0ms) begin transaction
5638
+ -------------------
5639
+ UserTest: test_tels
5640
+ -------------------
5641
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5642
+  (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"]]
5643
+  (0.1ms) rollback transaction
5644
+  (0.0ms) begin transaction
5645
+ -----------------------
5646
+ UserTest: test_save_tel
5647
+ -----------------------
5648
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5649
+ 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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5650
+  (0.0ms) SAVEPOINT active_record_1
5651
+ SQL (0.1ms) 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
+ 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-16"]]
5653
+ SQL (0.1ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5655
+ 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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5656
+  (0.0ms) SAVEPOINT active_record_1
5657
+ SQL (0.2ms) 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
+ 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-18"]]
5659
+ 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-18"], ["value", "555-123-4567"], ["created_at", "2016-08-16 08:10:35.772597"], ["updated_at", "2016-08-16 08:10:35.772597"]]
5660
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5661
+ 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-16') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5662
+ 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-17') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5663
+ 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-18') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5664
+  (0.1ms) rollback transaction
5665
+  (0.1ms) begin transaction
5666
+ --------------------------------------------
5667
+ NostalgicTest: test_it_does_something_useful
5668
+ --------------------------------------------
5669
+  (0.0ms) rollback transaction
5670
+  (0.0ms) begin transaction
5671
+ ------------------------------------------------
5672
+ NostalgicTest: test_that_it_has_a_version_number
5673
+ ------------------------------------------------
5674
+  (0.0ms) rollback transaction
5675
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5676
+  (0.1ms) begin transaction
5677
+ Fixture Delete (1.4ms) DELETE FROM "nostalgic_attrs"
5678
+ 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-19', '2016-08-18 23:31:41', '2016-08-18 23:31:41')
5679
+ 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-19', '2016-08-18 23:31:41', '2016-08-18 23:31:41')
5680
+ Fixture Insert (0.1ms) 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
+ Fixture Delete (0.1ms) DELETE FROM "users"
5682
+ Fixture Insert (0.1ms) 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
+  (1.6ms) commit transaction
5684
+  (0.0ms) begin transaction
5685
+ -----------------------------------------
5686
+ Nostalgic::AttrTest: test_nostalgic_model
5687
+ -----------------------------------------
5688
+  (0.1ms) rollback transaction
5689
+  (0.1ms) begin transaction
5690
+ --------------------------------------------
5691
+ NostalgicTest: test_it_does_something_useful
5692
+ --------------------------------------------
5693
+  (0.0ms) rollback transaction
5694
+  (0.0ms) begin transaction
5695
+ ------------------------------------------------
5696
+ NostalgicTest: test_that_it_has_a_version_number
5697
+ ------------------------------------------------
5698
+  (0.0ms) rollback transaction
5699
+  (0.0ms) begin transaction
5700
+ -------------------
5701
+ UserTest: test_tels
5702
+ -------------------
5703
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5704
+  (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"]]
5705
+  (0.1ms) rollback transaction
5706
+  (0.0ms) begin transaction
5707
+ -----------------------
5708
+ UserTest: test_save_tel
5709
+ -----------------------
5710
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5711
+ 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-19') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5712
+  (0.0ms) SAVEPOINT active_record_1
5713
+ SQL (0.2ms) 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
+ 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-19"]]
5715
+ SQL (0.1ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5717
+ 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-19') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5718
+  (0.1ms) SAVEPOINT active_record_1
5719
+ SQL (0.2ms) 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
+ 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-21"]]
5721
+ SQL (0.1ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5723
+ 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-19') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5724
+ 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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5725
+ 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-21') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5726
+  (0.2ms) rollback transaction
5727
+  (0.1ms) begin transaction
5728
+ ------------------
5729
+ UserTest: test_tel
5730
+ ------------------
5731
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
5732
+ 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-18') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5733
+ 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-19') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5734
+ 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-20') ORDER BY effective_at desc LIMIT 1 [["model_type", "User"], ["model_id", 1], ["name", "tel"]]
5735
+  (0.1ms) 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.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-16 00:00:00.000000000 Z
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