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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b776cc74377da7ae7d813f539840fb1a7f5fa55
4
- data.tar.gz: bb48620a819f8bd5568a8f3cb5f3fc073998a9d3
3
+ metadata.gz: b1cb26b89030f532c066b9a1dfefdd50d0b51f83
4
+ data.tar.gz: cc1757b3afab73d3ab6337fd55d3729f14f9860a
5
5
  SHA512:
6
- metadata.gz: ecff8ec03513af7b0aea0681a8abca7b9a712a280a4316862e2b1f5bd9081398afd59940f5532cceaff91308a139d110433655c38e138877f8f95e40a7f22529
7
- data.tar.gz: 39b95d11e3878347798bc50833ead1bc31f8747208e323a13fc550f0969efda8c513cc041968b88d1686c60e21c825e55e97c70149a73c0c575e0a57d44f5b1d
6
+ metadata.gz: 5bfa7af99706f57207a46e0c19b8804c83354c906c734260071302ed193d48e00cb0da4b43da0f96b9652809ffd48abf0210506a7a33cab20d4b8133c931abbf
7
+ data.tar.gz: be888e57acbca06863ca8dcf1b62adb1e394b6c533fccfb70442edc2deb4c4c521dd10f249df384497f178ae9567e0fc08bb618a9563332bd7c2af205a5e42ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- we_bridge_rails_engine_orgs (0.1.12)
4
+ we_bridge_rails_engine_orgs (0.1.13)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineOrgs
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
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
+ Org Load (46.4ms) SELECT "orgs".* FROM "orgs" ORDER BY "orgs"."id" ASC LIMIT 1
34772
+ OrgMemberType Load (0.8ms) SELECT "org_member_types".* FROM "org_member_types" WHERE "org_member_types"."org_id" = ? [["org_id", 1]]
@@ -5467,3 +5467,188 @@ Completed 200 OK in 38ms (Views: 24.8ms | ActiveRecord: 0.8ms)
5467
5467
   (0.1ms) 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"]]
5468
5468
  OrgMember Load (0.1ms) 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
   (0.8ms) rollback transaction
5470
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5471
+  (1.3ms) CREATE 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) 
5472
+  (0.1ms) select sqlite_version(*)
5473
+  (1.1ms) CREATE UNIQUE INDEX "index_lang_texts_on_parent_id_and_lang_id" ON "lang_texts" ("parent_id", "lang_id")
5474
+  (1.2ms) 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
+  (1.2ms) CREATE UNIQUE INDEX "index_langs_on_code" ON "langs" ("code")
5476
+  (1.0ms) 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
+  (1.0ms) CREATE 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) 
5478
+  (0.9ms) CREATE UNIQUE INDEX "index_org_activity_texts_on_lang_id_and_parent_id" ON "org_activity_texts" ("lang_id", "parent_id")
5479
+  (1.0ms) CREATE 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) 
5480
+  (1.2ms) CREATE UNIQUE INDEX "index_org_branch_member_mappings" ON "org_branch_member_mappings" ("org_member_id", "org_branch_id")
5481
+  (1.0ms) CREATE 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) 
5482
+  (1.0ms) CREATE UNIQUE INDEX "index_org_branch_texts" ON "org_branch_texts" ("parent_id", "lang_id")
5483
+  (0.9ms) CREATE 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) 
5484
+  (0.8ms) CREATE UNIQUE INDEX "index_org_branch_type_texts" ON "org_branch_type_texts" ("parent_id", "lang_id")
5485
+  (0.8ms) CREATE 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) 
5486
+  (1.0ms) 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
+  (1.0ms) CREATE 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) 
5488
+  (1.0ms) CREATE UNIQUE INDEX "index_org_department_position_member_mappings" ON "org_department_position_member_mappings" ("org_department_position_id", "org_member_id")
5489
+  (1.0ms) CREATE 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) 
5490
+  (0.9ms) CREATE UNIQUE INDEX "index_org_department_position_texts" ON "org_department_position_texts" ("lang_id", "parent_id")
5491
+  (1.1ms) CREATE 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) 
5492
+  (1.0ms) 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
+  (1.0ms) CREATE UNIQUE INDEX "index_org_department_texts" ON "org_department_texts" ("lang_id", "parent_id")
5494
+  (1.1ms) 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
+  (1.0ms) CREATE 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) 
5496
+  (1.0ms) CREATE UNIQUE INDEX "index_org_director_type_texts_on_parent_id_and_lang_id" ON "org_director_type_texts" ("parent_id", "lang_id")
5497
+  (0.9ms) CREATE 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) 
5498
+  (0.9ms) 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
+  (1.1ms) CREATE UNIQUE INDEX "index_org_member_tag_mappings" ON "org_member_tag_mappings" ("org_member_tag_id", "org_member_id")
5500
+  (1.1ms) 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
+  (1.0ms) CREATE UNIQUE INDEX "index_org_member_tag_texts_on_lang_id_and_parent_id" ON "org_member_tag_texts" ("lang_id", "parent_id")
5502
+  (1.0ms) 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
+  (1.1ms) CREATE 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) 
5504
+  (1.1ms) CREATE UNIQUE INDEX "index_org_member_texts_on_lang_id_and_parent_id" ON "org_member_texts" ("lang_id", "parent_id")
5505
+  (1.0ms) CREATE 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) 
5506
+  (1.0ms) CREATE UNIQUE INDEX "index_org_member_type_texts_on_lang_id_and_parent_id" ON "org_member_type_texts" ("lang_id", "parent_id")
5507
+  (1.2ms) CREATE 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) 
5508
+  (1.3ms) 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
+  (1.5ms) CREATE 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) 
5510
+  (1.3ms) CREATE UNIQUE INDEX "index_org_texts" ON "org_texts" ("lang_id", "parent_id")
5511
+  (1.5ms) CREATE 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) 
5512
+  (1.2ms) 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
+  (1.1ms) CREATE 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) 
5514
+  (1.1ms) CREATE UNIQUE INDEX "idx_person_name_texts" ON "person_name_texts" ("parent_id", "lang_id")
5515
+  (1.4ms) CREATE 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) 
5516
+  (1.3ms) CREATE UNIQUE INDEX "index_person_names_on_person_id_and_revision" ON "person_names" ("person_id", "revision")
5517
+  (1.0ms) CREATE 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) 
5518
+  (1.0ms) CREATE UNIQUE INDEX "index_person_texts_on_parent_id_and_lang_id" ON "person_texts" ("parent_id", "lang_id")
5519
+  (1.0ms) CREATE 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) 
5520
+  (1.0ms) CREATE UNIQUE INDEX "index_user_accounts_on_uid" ON "user_accounts" ("uid")
5521
+  (1.0ms) CREATE 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) 
5522
+  (1.2ms) CREATE UNIQUE INDEX "index_user_texts_on_lang_id_and_parent_id" ON "user_texts" ("lang_id", "parent_id")
5523
+  (1.2ms) CREATE 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) 
5524
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
5525
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5526
+  (0.1ms) SELECT version FROM "schema_migrations"
5527
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20151220104955')
5528
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150812025526')
5529
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20150814183339')
5530
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20151009112829')
5531
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20151203153522')
5532
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20151204024709')
5533
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20151204183447')
5534
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151204183612')
5535
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20151216145030')
5536
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151216145424')
5537
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150803101150')
5538
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150814101311')
5539
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150612005752')
5540
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150712132226')
5541
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5542
+  (0.2ms) begin transaction
5543
+  (0.1ms) SAVEPOINT active_record_1
5544
+ SQL (0.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.453770"], ["updated_at", "2015-12-22 03:08:53.453770"]]
5545
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5546
+  (0.1ms) SAVEPOINT active_record_1
5547
+ SQL (0.4ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5549
+  (0.0ms) SAVEPOINT active_record_1
5550
+ SQL (0.2ms) UPDATE "org_members" SET "retired_on" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["retired_on", nil], ["updated_at", "2015-12-22 03:08:53.479823"], ["id", 1]]
5551
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5552
+ OrgMember Load (0.3ms) 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]]
5553
+  (0.6ms) rollback transaction
5554
+  (0.1ms) begin transaction
5555
+  (0.2ms) SAVEPOINT active_record_1
5556
+ SQL (0.2ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.529042"], ["updated_at", "2015-12-22 03:08:53.529042"]]
5557
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5558
+  (0.0ms) SAVEPOINT active_record_1
5559
+ SQL (0.3ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5561
+  (0.1ms) SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? [["org_id", 1]]
5562
+  (0.6ms) rollback transaction
5563
+  (0.1ms) begin transaction
5564
+  (0.0ms) SAVEPOINT active_record_1
5565
+ SQL (0.5ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5567
+  (0.1ms) SAVEPOINT active_record_1
5568
+ SQL (0.4ms) 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:08:53.541584"], ["updated_at", "2015-12-22 03:08:53.541584"]]
5569
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5570
+  (0.0ms) SAVEPOINT active_record_1
5571
+ SQL (0.1ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5573
+  (0.1ms) 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
+ OrgMember Load (0.2ms) 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"]]
5575
+  (0.7ms) rollback transaction
5576
+  (0.1ms) begin transaction
5577
+  (0.1ms) SAVEPOINT active_record_1
5578
+ SQL (0.2ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.549330"], ["updated_at", "2015-12-22 03:08:53.549330"]]
5579
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5580
+  (0.0ms) SAVEPOINT active_record_1
5581
+ SQL (0.3ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5583
+  (0.1ms) 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
+ OrgMember Load (0.1ms) 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]]
5585
+  (0.8ms) rollback transaction
5586
+  (0.1ms) begin transaction
5587
+  (0.1ms) SAVEPOINT active_record_1
5588
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:08:53.557247"], ["updated_at", "2015-12-22 03:08:53.557247"]]
5589
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5590
+  (0.1ms) SAVEPOINT active_record_1
5591
+ SQL (0.5ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5593
+  (0.1ms) SAVEPOINT active_record_1
5594
+ SQL (0.2ms) 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:08:53.564270"], ["id", 1]]
5595
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5596
+  (0.1ms) 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]]
5597
+  (0.8ms) rollback transaction
5598
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5599
+  (0.1ms) begin transaction
5600
+  (0.1ms) SAVEPOINT active_record_1
5601
+ SQL (0.3ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5603
+  (0.1ms) SAVEPOINT active_record_1
5604
+ SQL (0.5ms) 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:09:05.894332"], ["updated_at", "2015-12-22 03:09:05.894332"]]
5605
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5606
+  (0.0ms) SAVEPOINT active_record_1
5607
+ SQL (0.2ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5609
+ OrgMember Load (0.3ms) 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
+  (8.9ms) rollback transaction
5611
+  (0.2ms) begin transaction
5612
+  (0.1ms) SAVEPOINT active_record_1
5613
+ SQL (0.4ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5615
+  (0.1ms) SAVEPOINT active_record_1
5616
+ SQL (0.4ms) 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:09:05.941997"], ["updated_at", "2015-12-22 03:09:05.941997"]]
5617
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5618
+  (0.2ms) SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? [["org_id", 1]]
5619
+  (0.8ms) rollback transaction
5620
+  (0.1ms) begin transaction
5621
+  (0.0ms) SAVEPOINT active_record_1
5622
+ SQL (0.2ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-22 03:09:05.948507"], ["updated_at", "2015-12-22 03:09:05.948507"]]
5623
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5624
+  (0.0ms) SAVEPOINT active_record_1
5625
+ SQL (0.3ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5627
+  (0.1ms) SAVEPOINT active_record_1
5628
+ SQL (0.4ms) 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:09:05.953577"], ["updated_at", "2015-12-22 03:09:05.953577"]]
5629
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5630
+  (0.2ms) 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"]]
5631
+ OrgMember Load (0.1ms) 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
+  (0.7ms) rollback transaction
5633
+  (0.1ms) begin transaction
5634
+  (0.0ms) SAVEPOINT active_record_1
5635
+ SQL (0.3ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5637
+  (0.0ms) SAVEPOINT active_record_1
5638
+ SQL (0.3ms) 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:09:05.964206"], ["updated_at", "2015-12-22 03:09:05.964206"]]
5639
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5640
+  (0.1ms) 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]]
5641
+ OrgMember Load (0.1ms) 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
+  (0.6ms) rollback transaction
5643
+  (0.0ms) begin transaction
5644
+  (0.0ms) SAVEPOINT active_record_1
5645
+ SQL (0.2ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5647
+  (0.1ms) SAVEPOINT active_record_1
5648
+ SQL (0.3ms) 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:09:05.971910"], ["updated_at", "2015-12-22 03:09:05.971910"]]
5649
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5650
+  (0.0ms) SAVEPOINT active_record_1
5651
+ SQL (0.1ms) 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
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5653
+  (0.0ms) 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
+  (0.8ms) rollback transaction
@@ -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.12
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-20 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-mlang