we_bridge_rails_engine_orgs 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/models/org_member.rb +1 -0
- data/lib/we_bridge_rails_engine_orgs/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +2 -0
- data/spec/dummy/log/test.log +185 -0
- data/spec/models/org_member_spec.rb +19 -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: b1cb26b89030f532c066b9a1dfefdd50d0b51f83
|
4
|
+
data.tar.gz: cc1757b3afab73d3ab6337fd55d3729f14f9860a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bfa7af99706f57207a46e0c19b8804c83354c906c734260071302ed193d48e00cb0da4b43da0f96b9652809ffd48abf0210506a7a33cab20d4b8133c931abbf
|
7
|
+
data.tar.gz: be888e57acbca06863ca8dcf1b62adb1e394b6c533fccfb70442edc2deb4c4c521dd10f249df384497f178ae9567e0fc08bb618a9563332bd7c2af205a5e42ab
|
data/Gemfile.lock
CHANGED
data/app/models/org_member.rb
CHANGED
@@ -26,6 +26,7 @@ class OrgMember < ActiveRecord::Base
|
|
26
26
|
|
27
27
|
default_scope ->(){ where(retired_on: nil) }
|
28
28
|
scope :without_secret, ->(){ where(private: false) }
|
29
|
+
scope :without_director, ->(){ where(org_director_type_id: nil) }
|
29
30
|
|
30
31
|
def others
|
31
32
|
self.class.where(org_id: self.org_id).where.not(id: self.id)
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -34768,3 +34768,5 @@ Migrating to AddPhoneNumberToOrgMember (20151220104955)
|
|
34768
34768
|
FROM sqlite_temp_master
|
34769
34769
|
WHERE name='index_user_texts_on_lang_id_and_parent_id' AND type='index'
|
34770
34770
|
|
34771
|
+
[1m[35mOrg Load (46.4ms)[0m SELECT "orgs".* FROM "orgs" ORDER BY "orgs"."id" ASC LIMIT 1
|
34772
|
+
[1m[36mOrgMemberType Load (0.8ms)[0m [1mSELECT "org_member_types".* FROM "org_member_types" WHERE "org_member_types"."org_id" = ?[0m [["org_id", 1]]
|
data/spec/dummy/log/test.log
CHANGED
@@ -5467,3 +5467,188 @@ Completed 200 OK in 38ms (Views: 24.8ms | ActiveRecord: 0.8ms)
|
|
5467
5467
|
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ?[0m [["org_id", 1], ["private", "f"]]
|
5468
5468
|
[1m[35mOrgMember Load (0.1ms)[0m SELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ? ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1], ["private", "f"]]
|
5469
5469
|
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
5470
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5471
|
+
[1m[36m (1.3ms)[0m [1mCREATE TABLE "lang_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5472
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
5473
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "index_lang_texts_on_parent_id_and_lang_id" ON "lang_texts" ("parent_id", "lang_id")[0m
|
5474
|
+
[1m[35m (1.2ms)[0m CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 10000 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5475
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "index_langs_on_code" ON "langs" ("code")[0m
|
5476
|
+
[1m[35m (1.0ms)[0m CREATE TABLE "org_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "position" integer DEFAULT 0 NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5477
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_activity_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "description" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5478
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "index_org_activity_texts_on_lang_id_and_parent_id" ON "org_activity_texts" ("lang_id", "parent_id")
|
5479
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_branch_member_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_member_id" integer NOT NULL, "org_branch_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5480
|
+
[1m[35m (1.2ms)[0m CREATE UNIQUE INDEX "index_org_branch_member_mappings" ON "org_branch_member_mappings" ("org_member_id", "org_branch_id")
|
5481
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_branch_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5482
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_org_branch_texts" ON "org_branch_texts" ("parent_id", "lang_id")
|
5483
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "org_branch_type_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "desc" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5484
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_org_branch_type_texts" ON "org_branch_type_texts" ("parent_id", "lang_id")
|
5485
|
+
[1m[36m (0.8ms)[0m [1mCREATE TABLE "org_branch_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "position" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5486
|
+
[1m[35m (1.0ms)[0m CREATE TABLE "org_branches" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_branch_type_id" integer NOT NULL, "org_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "position" integer DEFAULT 0 NOT NULL)
|
5487
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_department_position_member_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_department_position_id" integer NOT NULL, "org_member_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5488
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_org_department_position_member_mappings" ON "org_department_position_member_mappings" ("org_department_position_id", "org_member_id")
|
5489
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_department_position_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "name" varchar DEFAULT '' NOT NULL, "desc" text DEFAULT '' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5490
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "index_org_department_position_texts" ON "org_department_position_texts" ("lang_id", "parent_id")
|
5491
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "org_department_positions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_department_id" integer NOT NULL, "position" integer DEFAULT 0 NOT NULL, "limit" integer DEFAULT 0 NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5492
|
+
[1m[35m (1.0ms)[0m CREATE TABLE "org_department_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "name" varchar DEFAULT '' NOT NULL, "desc" text DEFAULT '' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5493
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "index_org_department_texts" ON "org_department_texts" ("lang_id", "parent_id")[0m
|
5494
|
+
[1m[35m (1.1ms)[0m CREATE TABLE "org_departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "manager_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5495
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_director_type_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "desc" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5496
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_org_director_type_texts_on_parent_id_and_lang_id" ON "org_director_type_texts" ("parent_id", "lang_id")
|
5497
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "org_director_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "position" integer DEFAULT 0 NOT NULL, "limit" integer DEFAULT 0 NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5498
|
+
[1m[35m (0.9ms)[0m CREATE TABLE "org_member_tag_mappings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_member_tag_id" integer NOT NULL, "org_member_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5499
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "index_org_member_tag_mappings" ON "org_member_tag_mappings" ("org_member_tag_id", "org_member_id")[0m
|
5500
|
+
[1m[35m (1.1ms)[0m CREATE TABLE "org_member_tag_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5501
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "index_org_member_tag_texts_on_lang_id_and_parent_id" ON "org_member_tag_texts" ("lang_id", "parent_id")[0m
|
5502
|
+
[1m[35m (1.0ms)[0m CREATE TABLE "org_member_tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
5503
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "org_member_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "comment" text, "comment_format" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "family_name" varchar DEFAULT '' NOT NULL, "given_name" varchar DEFAULT '' NOT NULL, "family_name_pron" varchar DEFAULT '' NOT NULL, "given_name_pron" varchar DEFAULT '' NOT NULL) [0m
|
5504
|
+
[1m[35m (1.1ms)[0m CREATE UNIQUE INDEX "index_org_member_texts_on_lang_id_and_parent_id" ON "org_member_texts" ("lang_id", "parent_id")
|
5505
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "org_member_type_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "desc" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5506
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_org_member_type_texts_on_lang_id_and_parent_id" ON "org_member_type_texts" ("lang_id", "parent_id")
|
5507
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "org_member_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer NOT NULL, "position" integer DEFAULT 0 NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5508
|
+
[1m[35m (1.3ms)[0m CREATE TABLE "org_members" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "org_id" integer, "user_id" integer, "lang_id" integer, "type_id" integer DEFAULT 0 NOT NULL, "org_director_type_id" integer, "org_member_type_id" integer, "byear" integer, "bmonth" integer, "bday" integer, "entried_on" date NOT NULL, "sex" integer(1), "expire_at" datetime, "retired_on" date, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "handle_name" varchar DEFAULT '' NOT NULL, "private" boolean DEFAULT 'f' NOT NULL, "uuid" varchar(40) DEFAULT '' NOT NULL, "phone_number" varchar)
|
5509
|
+
[1m[36m (1.5ms)[0m [1mCREATE TABLE "org_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "name" varchar, "description" text, "www_author" varchar, "www_keywords" varchar, "address" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5510
|
+
[1m[35m (1.3ms)[0m CREATE UNIQUE INDEX "index_org_texts" ON "org_texts" ("lang_id", "parent_id")
|
5511
|
+
[1m[36m (1.5ms)[0m [1mCREATE TABLE "orgs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "lang_id" integer NOT NULL, "email" varchar, "url" varchar, "domain" varchar, "started_on" date, "post_number" varchar, "tel" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
5512
|
+
[1m[35m (1.2ms)[0m CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "sex" integer DEFAULT 1 NOT NULL, "birth_year" integer DEFAULT 0 NOT NULL, "birth_month" integer DEFAULT 0 NOT NULL, "birth_day" integer DEFAULT 0 NOT NULL, "blood_type" varchar, "created_by" integer NOT NULL, "updated_by" integer NOT NULL, "created_at" datetime, "updated_at" datetime)
|
5513
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "person_name_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "first_name" varchar, "first_name_pron" varchar, "last_name" varchar, "last_name_pron" varchar) [0m
|
5514
|
+
[1m[35m (1.1ms)[0m CREATE UNIQUE INDEX "idx_person_name_texts" ON "person_name_texts" ("parent_id", "lang_id")
|
5515
|
+
[1m[36m (1.4ms)[0m [1mCREATE TABLE "person_names" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "person_id" integer NOT NULL, "revision" integer DEFAULT 0 NOT NULL, "modified_on" date NOT NULL, "created_at" datetime, "updated_at" datetime) [0m
|
5516
|
+
[1m[35m (1.3ms)[0m CREATE UNIQUE INDEX "index_person_names_on_person_id_and_revision" ON "person_names" ("person_id", "revision")
|
5517
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "person_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "created_by" integer NOT NULL, "updated_by" integer NOT NULL, "created_at" datetime, "updated_at" datetime) [0m
|
5518
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_person_texts_on_parent_id_and_lang_id" ON "person_texts" ("parent_id", "lang_id")
|
5519
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "user_accounts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "provider" varchar NOT NULL, "uid" varchar NOT NULL, "token" varchar, "name" varchar, "nickname" varchar, "email" varchar, "url" varchar, "image_url" varchar, "description" varchar, "other" text, "credentials" text, "raw_info" text, "deleted_at" datetime, "created_at" datetime, "updated_at" datetime) [0m
|
5520
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_user_accounts_on_uid" ON "user_accounts" ("uid")
|
5521
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "user_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "nick_name" varchar, "nick_name_pron" varchar, "deleted_at" datetime, "created_at" datetime, "updated_at" datetime) [0m
|
5522
|
+
[1m[35m (1.2ms)[0m CREATE UNIQUE INDEX "index_user_texts_on_lang_id_and_parent_id" ON "user_texts" ("lang_id", "parent_id")
|
5523
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "person_id" integer, "email" varchar, "user_img_url" varchar, "lang_id" integer NOT NULL, "deleted_at" datetime, "created_at" datetime, "updated_at" datetime) [0m
|
5524
|
+
[1m[35m (1.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
5525
|
+
[1m[36m (1.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
5526
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
5527
|
+
[1m[36m (1.2ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151220104955')[0m
|
5528
|
+
[1m[35m (1.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150812025526')
|
5529
|
+
[1m[36m (1.2ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150814183339')[0m
|
5530
|
+
[1m[35m (1.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20151009112829')
|
5531
|
+
[1m[36m (1.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151203153522')[0m
|
5532
|
+
[1m[35m (1.2ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20151204024709')
|
5533
|
+
[1m[36m (1.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151204183447')[0m
|
5534
|
+
[1m[35m (0.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20151204183612')
|
5535
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20151216145030')[0m
|
5536
|
+
[1m[35m (0.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20151216145424')
|
5537
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150803101150')[0m
|
5538
|
+
[1m[35m (0.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150814101311')
|
5539
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150612005752')[0m
|
5540
|
+
[1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150712132226')
|
5541
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5542
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
5543
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5544
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.453770"], ["updated_at", "2015-12-22 03:08:53.453770"]]
|
5545
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5546
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5547
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "retired_on", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["retired_on", "2015-12-22"], ["created_at", "2015-12-22 03:08:53.476679"], ["updated_at", "2015-12-22 03:08:53.476679"]]
|
5548
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5549
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5550
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "org_members" SET "retired_on" = ?, "updated_at" = ? WHERE "org_members"."id" = ?[0m [["retired_on", nil], ["updated_at", "2015-12-22 03:08:53.479823"], ["id", 1]]
|
5551
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5552
|
+
[1m[36mOrgMember Load (0.3ms)[0m [1mSELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? ORDER BY "org_members"."id" ASC LIMIT 1[0m [["org_id", 1]]
|
5553
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
5554
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5555
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
5556
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.529042"], ["updated_at", "2015-12-22 03:08:53.529042"]]
|
5557
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
5558
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5559
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "retired_on", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["retired_on", "2015-12-22"], ["created_at", "2015-12-22 03:08:53.531300"], ["updated_at", "2015-12-22 03:08:53.531300"]]
|
5560
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5561
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? [["org_id", 1]]
|
5562
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
5563
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5564
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5565
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.536033"], ["updated_at", "2015-12-22 03:08:53.536033"]]
|
5566
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5567
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5568
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "private", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["private", "t"], ["created_at", "2015-12-22 03:08:53.541584"], ["updated_at", "2015-12-22 03:08:53.541584"]]
|
5569
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5570
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5571
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:08:53.543902"], ["updated_at", "2015-12-22 03:08:53.543902"]]
|
5572
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5573
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ? [["org_id", 1], ["private", "f"]]
|
5574
|
+
[1m[36mOrgMember Load (0.2ms)[0m [1mSELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ? ORDER BY "org_members"."id" ASC LIMIT 1[0m [["org_id", 1], ["private", "f"]]
|
5575
|
+
[1m[35m (0.7ms)[0m rollback transaction
|
5576
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5577
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5578
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.549330"], ["updated_at", "2015-12-22 03:08:53.549330"]]
|
5579
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5580
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5581
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:08:53.551578"], ["updated_at", "2015-12-22 03:08:53.551578"]]
|
5582
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5583
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL [["org_id", 1]]
|
5584
|
+
[1m[36mOrgMember Load (0.1ms)[0m [1mSELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL ORDER BY "org_members"."id" ASC LIMIT 1[0m [["org_id", 1]]
|
5585
|
+
[1m[35m (0.8ms)[0m rollback transaction
|
5586
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5587
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5588
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.557247"], ["updated_at", "2015-12-22 03:08:53.557247"]]
|
5589
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5590
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5591
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:08:53.560732"], ["updated_at", "2015-12-22 03:08:53.560732"]]
|
5592
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5593
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5594
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ?[0m [["org_director_type_id", 1], ["updated_at", "2015-12-22 03:08:53.564270"], ["id", 1]]
|
5595
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5596
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL[0m [["org_id", 1]]
|
5597
|
+
[1m[35m (0.8ms)[0m rollback transaction
|
5598
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5599
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5600
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5601
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.877004"], ["updated_at", "2015-12-22 03:09:05.877004"]]
|
5602
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5603
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5604
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "retired_on", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["retired_on", "2015-12-22"], ["created_at", "2015-12-22 03:09:05.894332"], ["updated_at", "2015-12-22 03:09:05.894332"]]
|
5605
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5606
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5607
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "org_members" SET "retired_on" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["retired_on", nil], ["updated_at", "2015-12-22 03:09:05.896708"], ["id", 1]]
|
5608
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5609
|
+
[1m[35mOrgMember Load (0.3ms)[0m SELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
|
5610
|
+
[1m[36m (8.9ms)[0m [1mrollback transaction[0m
|
5611
|
+
[1m[35m (0.2ms)[0m begin transaction
|
5612
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5613
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.937606"], ["updated_at", "2015-12-22 03:09:05.937606"]]
|
5614
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5615
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5616
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "retired_on", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["retired_on", "2015-12-22"], ["created_at", "2015-12-22 03:09:05.941997"], ["updated_at", "2015-12-22 03:09:05.941997"]]
|
5617
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5618
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ?[0m [["org_id", 1]]
|
5619
|
+
[1m[35m (0.8ms)[0m rollback transaction
|
5620
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5621
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5622
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?)[0m [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.948507"], ["updated_at", "2015-12-22 03:09:05.948507"]]
|
5623
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5624
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5625
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "org_members" ("org_id", "entried_on", "private", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-22"], ["private", "t"], ["created_at", "2015-12-22 03:09:05.950956"], ["updated_at", "2015-12-22 03:09:05.950956"]]
|
5626
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5627
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5628
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:09:05.953577"], ["updated_at", "2015-12-22 03:09:05.953577"]]
|
5629
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5630
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ?[0m [["org_id", 1], ["private", "f"]]
|
5631
|
+
[1m[35mOrgMember Load (0.1ms)[0m SELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."private" = ? ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1], ["private", "f"]]
|
5632
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
5633
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5634
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5635
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.961573"], ["updated_at", "2015-12-22 03:09:05.961573"]]
|
5636
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5637
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
5638
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:09:05.964206"], ["updated_at", "2015-12-22 03:09:05.964206"]]
|
5639
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5640
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL[0m [["org_id", 1]]
|
5641
|
+
[1m[35mOrgMember Load (0.1ms)[0m SELECT "org_members".* FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
|
5642
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
5643
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5644
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5645
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.969401"], ["updated_at", "2015-12-22 03:09:05.969401"]]
|
5646
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5647
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5648
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["org_id", 1], ["entried_on", "2015-12-22"], ["created_at", "2015-12-22 03:09:05.971910"], ["updated_at", "2015-12-22 03:09:05.971910"]]
|
5649
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5650
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
5651
|
+
[1m[35mSQL (0.1ms)[0m UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 1], ["updated_at", "2015-12-22 03:09:05.973696"], ["id", 1]]
|
5652
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5653
|
+
[1m[35m (0.0ms)[0m SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? AND "org_members"."org_director_type_id" IS NULL [["org_id", 1]]
|
5654
|
+
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
@@ -25,10 +25,29 @@ RSpec.describe OrgMember, type: :model do
|
|
25
25
|
@member = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, private: true)
|
26
26
|
@member2 = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, private: false)
|
27
27
|
end
|
28
|
+
|
28
29
|
it "hit only one user" do
|
29
30
|
res = @org.members.without_secret
|
30
31
|
expect(res.count).to eq(1)
|
31
32
|
expect(res.first.id).to eq(@member2.id)
|
32
33
|
end
|
33
34
|
end
|
35
|
+
|
36
|
+
context ".without_director" do
|
37
|
+
before do
|
38
|
+
@member = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, private: false, org_director_type_id: nil)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "hit only one user" do
|
42
|
+
res = @org.members.without_director
|
43
|
+
expect(res.count).to eq(1)
|
44
|
+
expect(res.first.id).to eq(@member.id)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "hit no user" do
|
48
|
+
@member.update(org_director_type_id: 1)
|
49
|
+
res = @org.members.without_director
|
50
|
+
expect(res.count).to eq(0)
|
51
|
+
end
|
52
|
+
end
|
34
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: we_bridge_rails_engine_orgs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinjiro Itagaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-mlang
|