we_bridge_rails_engine_orgs 0.1.7 → 0.1.8

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: 14b9016374ad865cee705818e1fedcc60a6aecf7
4
- data.tar.gz: 1fe2962883d1053edd554e5a4cf714ba72d1dd8e
3
+ metadata.gz: de33d3993b5400f1602ac9a1ca7c7a6d977ac726
4
+ data.tar.gz: 390c4088ffa4ae3b0d90a0aca5127833ec70d786
5
5
  SHA512:
6
- metadata.gz: 04cbf683c96391ab51fbcdc1b1461cc52d2d427eea06bccac18d67f3580e8fd76a47cc941394daefe037031a1dd6119e76308eda10be10d66f8e7811fc12fd8e
7
- data.tar.gz: 3fbe31cbe763da133302f89c64de3bd28fb8f2e1c8a50b4d4b2bbc698b0bf43d140c2085a4d34842cb80adf2b786a6491ac2f62749456c662640c76d9356b7d8
6
+ metadata.gz: 38872d11acc88826033ffce1a004f28ebd40c4b1e58e10265ae9c25fc1555ebc32296238572aa35d8b80ded9f8110353b133cbcca9f8d2d5ef3c9f1fdcb0f634
7
+ data.tar.gz: 617e2ab01197aa95e73350ae6998488bec1dd5130afcaef59259be2fdb583fc6e50d7366d138d4180c85ccee2578d2f14e961dc500dc68f5484967bbca42c29f
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.7)
4
+ we_bridge_rails_engine_orgs (0.1.8)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
data/app/models/org.rb CHANGED
@@ -8,6 +8,8 @@ class Org < ActiveRecord::Base
8
8
  has_many :member_types, class_name: "OrgMemberType"
9
9
  has_many :member_tags, class_name: "OrgMemberTag"
10
10
  has_many :activities, class_name: "OrgActivity"
11
+ has_many :branches, class_name: "OrgBranch"
12
+
11
13
  include ActiveRecord::Mlang
12
14
  include ActionView::Helpers::AutoTagHelper::FormInfo
13
15
  set_accessible_attrs :lang_id, :email,:url,:domain,:started_on,:post_number,:tel
@@ -19,5 +21,4 @@ class Org < ActiveRecord::Base
19
21
  tname = OrgDirectorType.table_name
20
22
  self.directors.joins(:org_director_type).where("#{tname}.position" => OrgDirectorType.where(org_id: self.id).minimum(:position)).order(id: :asc).uniq.first
21
23
  end
22
-
23
24
  end
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineOrgs
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -30993,3 +30993,4 @@ Migrating to CreateOrgDepartmentPositions (20151204183612)
30993
30993
  WHERE name='index_user_texts_on_lang_id_and_parent_id' AND type='index'
30994
30994
  
30995
30995
  OrgDepartment Load (0.2ms) SELECT "org_departments".* FROM "org_departments" ORDER BY "org_departments"."id" ASC LIMIT 1
30996
+ OrgBranch Load (5.8ms) SELECT "org_branches".* FROM "org_branches" ORDER BY "org_branches"."position" ASC, "org_branches"."id" ASC
@@ -3421,3 +3421,236 @@ Migrating to CreateOrgDepartmentPositions (20151204183612)
3421
3421
   (0.0ms) RELEASE SAVEPOINT active_record_1
3422
3422
   (0.1ms) SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? [["org_id", 1]]
3423
3423
   (0.7ms) rollback transaction
3424
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
3425
+  (0.1ms) begin transaction
3426
+  (0.1ms) SAVEPOINT active_record_1
3427
+ SQL (1.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:17:45.568813"], ["updated_at", "2015-12-08 12:17:45.568813"]]
3428
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3429
+  (0.1ms) SAVEPOINT active_record_1
3430
+ SQL (2.6ms) INSERT INTO "org_branches" ("org_id", "org_branch_type_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["org_branch_type_id", 1], ["created_at", "2015-12-08 12:17:45.592907"], ["updated_at", "2015-12-08 12:17:45.592907"]]
3431
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3432
+  (0.1ms) SAVEPOINT active_record_1
3433
+ SQL (0.1ms) INSERT INTO "org_branches" ("org_id", "org_branch_type_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["org_branch_type_id", 1], ["created_at", "2015-12-08 12:17:45.598024"], ["updated_at", "2015-12-08 12:17:45.598024"]]
3434
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3435
+  (0.1ms) SAVEPOINT active_record_1
3436
+ SQL (0.7ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.633291"], ["updated_at", "2015-12-08 12:17:45.633291"]]
3437
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3438
+ OrgBranchMemberMapping Load (0.6ms) SELECT "org_branch_member_mappings".* FROM "org_branch_member_mappings" WHERE "org_branch_member_mappings"."org_member_id" = ? AND "org_branch_member_mappings"."org_branch_id" = ? LIMIT 1 [["org_member_id", 1], ["org_branch_id", 1]]
3439
+  (0.1ms) SAVEPOINT active_record_1
3440
+ SQL (0.5ms) INSERT INTO "org_branch_member_mappings" ("org_member_id", "org_branch_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_member_id", 1], ["org_branch_id", 1], ["created_at", "2015-12-08 12:17:45.649232"], ["updated_at", "2015-12-08 12:17:45.649232"]]
3441
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3442
+  (0.2ms) SELECT COUNT(*) FROM "org_branches" WHERE "org_branches"."org_id" = ? [["org_id", 1]]
3443
+  (0.9ms) rollback transaction
3444
+  (0.1ms) begin transaction
3445
+  (0.0ms) SAVEPOINT active_record_1
3446
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:17:45.727671"], ["updated_at", "2015-12-08 12:17:45.727671"]]
3447
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3448
+  (0.0ms) SAVEPOINT active_record_1
3449
+ SQL (0.4ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.730827"], ["updated_at", "2015-12-08 12:17:45.730827"]]
3450
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3451
+  (0.0ms) SAVEPOINT active_record_1
3452
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.733400"], ["updated_at", "2015-12-08 12:17:45.733400"]]
3453
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3454
+  (0.1ms) SAVEPOINT active_record_1
3455
+ SQL (0.8ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:17:45.745646"], ["updated_at", "2015-12-08 12:17:45.745646"]]
3456
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3457
+  (0.1ms) SAVEPOINT active_record_1
3458
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:17:45.748753"], ["updated_at", "2015-12-08 12:17:45.748753"]]
3459
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3460
+  (0.2ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3461
+ OrgMember Load (0.3ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3462
+  (0.8ms) rollback transaction
3463
+  (0.1ms) begin transaction
3464
+  (0.1ms) SAVEPOINT active_record_1
3465
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:17:45.781563"], ["updated_at", "2015-12-08 12:17:45.781563"]]
3466
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3467
+  (0.0ms) SAVEPOINT active_record_1
3468
+ SQL (0.3ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.784374"], ["updated_at", "2015-12-08 12:17:45.784374"]]
3469
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3470
+  (0.0ms) SAVEPOINT active_record_1
3471
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.786414"], ["updated_at", "2015-12-08 12:17:45.786414"]]
3472
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3473
+  (0.1ms) SAVEPOINT active_record_1
3474
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:17:45.788706"], ["updated_at", "2015-12-08 12:17:45.788706"]]
3475
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3476
+  (0.0ms) SAVEPOINT active_record_1
3477
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:17:45.790672"], ["updated_at", "2015-12-08 12:17:45.790672"]]
3478
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3479
+  (0.0ms) SAVEPOINT active_record_1
3480
+ SQL (0.1ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:17:45.792208"], ["id", 1]]
3481
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3482
+  (0.1ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3483
+ OrgMember Load (0.1ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3484
+  (0.9ms) rollback transaction
3485
+  (0.1ms) begin transaction
3486
+  (0.1ms) SAVEPOINT active_record_1
3487
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:17:45.801318"], ["updated_at", "2015-12-08 12:17:45.801318"]]
3488
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3489
+  (0.1ms) SAVEPOINT active_record_1
3490
+ SQL (0.5ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.805198"], ["updated_at", "2015-12-08 12:17:45.805198"]]
3491
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3492
+  (0.1ms) SAVEPOINT active_record_1
3493
+ SQL (0.2ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.808270"], ["updated_at", "2015-12-08 12:17:45.808270"]]
3494
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3495
+  (0.0ms) SAVEPOINT active_record_1
3496
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:17:45.810574"], ["updated_at", "2015-12-08 12:17:45.810574"]]
3497
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3498
+  (0.1ms) SAVEPOINT active_record_1
3499
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:17:45.812584"], ["updated_at", "2015-12-08 12:17:45.812584"]]
3500
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3501
+  (0.0ms) SAVEPOINT active_record_1
3502
+ 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-08 12:17:45.814378"], ["id", 2]]
3503
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3504
+  (0.0ms) SAVEPOINT active_record_1
3505
+ SQL (0.1ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:17:45.816282"], ["id", 1]]
3506
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3507
+  (0.1ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3508
+ OrgMember Load (0.1ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3509
+  (0.8ms) rollback transaction
3510
+  (0.1ms) begin transaction
3511
+  (0.1ms) SAVEPOINT active_record_1
3512
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:17:45.824544"], ["updated_at", "2015-12-08 12:17:45.824544"]]
3513
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3514
+  (0.1ms) SAVEPOINT active_record_1
3515
+ SQL (0.7ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.827750"], ["updated_at", "2015-12-08 12:17:45.827750"]]
3516
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3517
+  (0.1ms) SAVEPOINT active_record_1
3518
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:17:45.831747"], ["updated_at", "2015-12-08 12:17:45.831747"]]
3519
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3520
+  (0.1ms) SAVEPOINT active_record_1
3521
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:17:45.835035"], ["updated_at", "2015-12-08 12:17:45.835035"]]
3522
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3523
+  (0.0ms) SAVEPOINT active_record_1
3524
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:17:45.836724"], ["updated_at", "2015-12-08 12:17:45.836724"]]
3525
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3526
+  (0.1ms) SAVEPOINT active_record_1
3527
+ 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-08 12:17:45.838792"], ["id", 2]]
3528
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3529
+  (0.0ms) SAVEPOINT active_record_1
3530
+ SQL (0.1ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:17:45.840654"], ["id", 1]]
3531
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3532
+  (0.0ms) SAVEPOINT active_record_1
3533
+ OrgDirectorType Load (0.1ms) SELECT "org_director_types"."limit" FROM "org_director_types" WHERE "org_director_types"."id" = ? ORDER BY "org_director_types"."id" ASC LIMIT 1 [["id", 1]]
3534
+ 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-08 12:17:45.843434"], ["id", 1]]
3535
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3536
+  (0.1ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3537
+ OrgMember Load (0.1ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3538
+  (1.0ms) rollback transaction
3539
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3540
+  (0.1ms) begin transaction
3541
+  (0.1ms) SAVEPOINT active_record_1
3542
+ SQL (0.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:18:32.029652"], ["updated_at", "2015-12-08 12:18:32.029652"]]
3543
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3544
+  (0.1ms) SAVEPOINT active_record_1
3545
+ SQL (1.1ms) INSERT INTO "org_branches" ("org_id", "org_branch_type_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 2], ["org_branch_type_id", 1], ["created_at", "2015-12-08 12:18:32.044763"], ["updated_at", "2015-12-08 12:18:32.044763"]]
3546
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3547
+  (0.0ms) SAVEPOINT active_record_1
3548
+ SQL (0.1ms) INSERT INTO "org_branches" ("org_id", "org_branch_type_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["org_branch_type_id", 1], ["created_at", "2015-12-08 12:18:32.048004"], ["updated_at", "2015-12-08 12:18:32.048004"]]
3549
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3550
+  (0.0ms) SAVEPOINT active_record_1
3551
+ SQL (0.1ms) INSERT INTO "org_branches" ("org_id", "org_branch_type_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["org_branch_type_id", 1], ["created_at", "2015-12-08 12:18:32.049650"], ["updated_at", "2015-12-08 12:18:32.049650"]]
3552
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3553
+  (0.1ms) SAVEPOINT active_record_1
3554
+ SQL (0.2ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.080543"], ["updated_at", "2015-12-08 12:18:32.080543"]]
3555
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3556
+ OrgBranchMemberMapping Load (0.1ms) SELECT "org_branch_member_mappings".* FROM "org_branch_member_mappings" WHERE "org_branch_member_mappings"."org_member_id" = ? AND "org_branch_member_mappings"."org_branch_id" = ? LIMIT 1 [["org_member_id", 1], ["org_branch_id", 2]]
3557
+  (0.1ms) SAVEPOINT active_record_1
3558
+ SQL (0.2ms) INSERT INTO "org_branch_member_mappings" ("org_member_id", "org_branch_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_member_id", 1], ["org_branch_id", 2], ["created_at", "2015-12-08 12:18:32.090148"], ["updated_at", "2015-12-08 12:18:32.090148"]]
3559
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3560
+  (0.1ms) SELECT COUNT(*) FROM "org_branches" WHERE "org_branches"."org_id" = ? [["org_id", 1]]
3561
+  (8.9ms) rollback transaction
3562
+  (0.1ms) begin transaction
3563
+  (0.1ms) SAVEPOINT active_record_1
3564
+ SQL (0.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:18:32.161507"], ["updated_at", "2015-12-08 12:18:32.161507"]]
3565
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3566
+  (0.1ms) SAVEPOINT active_record_1
3567
+ SQL (0.4ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.165865"], ["updated_at", "2015-12-08 12:18:32.165865"]]
3568
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3569
+  (0.0ms) SAVEPOINT active_record_1
3570
+ SQL (0.2ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.168358"], ["updated_at", "2015-12-08 12:18:32.168358"]]
3571
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3572
+  (0.1ms) SAVEPOINT active_record_1
3573
+ SQL (0.2ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:18:32.180962"], ["updated_at", "2015-12-08 12:18:32.180962"]]
3574
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3575
+  (0.0ms) SAVEPOINT active_record_1
3576
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:18:32.182565"], ["updated_at", "2015-12-08 12:18:32.182565"]]
3577
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3578
+  (0.2ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3579
+ OrgMember Load (0.3ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3580
+  (0.8ms) rollback transaction
3581
+  (0.1ms) begin transaction
3582
+  (0.0ms) SAVEPOINT active_record_1
3583
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:18:32.203398"], ["updated_at", "2015-12-08 12:18:32.203398"]]
3584
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3585
+  (0.0ms) SAVEPOINT active_record_1
3586
+ SQL (0.3ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.207546"], ["updated_at", "2015-12-08 12:18:32.207546"]]
3587
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3588
+  (0.0ms) SAVEPOINT active_record_1
3589
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.209558"], ["updated_at", "2015-12-08 12:18:32.209558"]]
3590
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3591
+  (0.0ms) SAVEPOINT active_record_1
3592
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:18:32.210982"], ["updated_at", "2015-12-08 12:18:32.210982"]]
3593
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3594
+  (0.0ms) SAVEPOINT active_record_1
3595
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:18:32.212639"], ["updated_at", "2015-12-08 12:18:32.212639"]]
3596
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3597
+  (0.0ms) SAVEPOINT active_record_1
3598
+ SQL (0.1ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:18:32.214250"], ["id", 1]]
3599
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3600
+  (0.0ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3601
+ OrgMember Load (0.0ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3602
+  (0.8ms) rollback transaction
3603
+  (0.1ms) begin transaction
3604
+  (0.0ms) SAVEPOINT active_record_1
3605
+ SQL (0.3ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:18:32.221735"], ["updated_at", "2015-12-08 12:18:32.221735"]]
3606
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3607
+  (0.0ms) SAVEPOINT active_record_1
3608
+ SQL (0.4ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.224502"], ["updated_at", "2015-12-08 12:18:32.224502"]]
3609
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3610
+  (0.0ms) SAVEPOINT active_record_1
3611
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.226760"], ["updated_at", "2015-12-08 12:18:32.226760"]]
3612
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3613
+  (0.0ms) SAVEPOINT active_record_1
3614
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:18:32.228496"], ["updated_at", "2015-12-08 12:18:32.228496"]]
3615
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3616
+  (0.1ms) SAVEPOINT active_record_1
3617
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:18:32.230108"], ["updated_at", "2015-12-08 12:18:32.230108"]]
3618
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3619
+  (0.0ms) SAVEPOINT active_record_1
3620
+ 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-08 12:18:32.231904"], ["id", 2]]
3621
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3622
+  (0.0ms) SAVEPOINT active_record_1
3623
+ SQL (0.0ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:18:32.233520"], ["id", 1]]
3624
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3625
+  (0.0ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3626
+ OrgMember Load (0.0ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3627
+  (0.7ms) rollback transaction
3628
+  (0.1ms) begin transaction
3629
+  (0.0ms) SAVEPOINT active_record_1
3630
+ SQL (0.2ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-08 12:18:32.238779"], ["updated_at", "2015-12-08 12:18:32.238779"]]
3631
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3632
+  (0.0ms) SAVEPOINT active_record_1
3633
+ SQL (0.3ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.241041"], ["updated_at", "2015-12-08 12:18:32.241041"]]
3634
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3635
+  (0.0ms) SAVEPOINT active_record_1
3636
+ SQL (0.1ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-08"], ["created_at", "2015-12-08 12:18:32.242756"], ["updated_at", "2015-12-08 12:18:32.242756"]]
3637
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3638
+  (0.0ms) SAVEPOINT active_record_1
3639
+ SQL (0.1ms) INSERT INTO "org_director_types" ("org_id", "created_at", "updated_at") VALUES (?, ?, ?) [["org_id", 1], ["created_at", "2015-12-08 12:18:32.244054"], ["updated_at", "2015-12-08 12:18:32.244054"]]
3640
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3641
+  (0.0ms) SAVEPOINT active_record_1
3642
+ SQL (0.0ms) INSERT INTO "org_director_types" ("org_id", "position", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["position", 1], ["created_at", "2015-12-08 12:18:32.245098"], ["updated_at", "2015-12-08 12:18:32.245098"]]
3643
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3644
+  (0.0ms) SAVEPOINT active_record_1
3645
+ SQL (0.0ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 1], ["updated_at", "2015-12-08 12:18:32.246184"], ["id", 2]]
3646
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3647
+  (0.0ms) SAVEPOINT active_record_1
3648
+ SQL (0.1ms) UPDATE "org_members" SET "org_director_type_id" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["org_director_type_id", 2], ["updated_at", "2015-12-08 12:18:32.247378"], ["id", 1]]
3649
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3650
+  (0.1ms) SAVEPOINT active_record_1
3651
+ OrgDirectorType Load (0.1ms) SELECT "org_director_types"."limit" FROM "org_director_types" WHERE "org_director_types"."id" = ? ORDER BY "org_director_types"."id" ASC LIMIT 1 [["id", 1]]
3652
+ 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-08 12:18:32.251253"], ["id", 1]]
3653
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3654
+  (0.1ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
3655
+ OrgMember Load (0.1ms) SELECT DISTINCT "org_members".* FROM "org_members" INNER JOIN "org_director_types" "org_director_types_org_members" ON "org_director_types_org_members"."id" = "org_members"."org_director_type_id" INNER JOIN "org_director_types" ON "org_members"."org_director_type_id" = "org_director_types"."id" WHERE "org_members"."retired_on" IS NULL AND "org_director_types"."org_id" = ? AND "org_director_types"."position" = 0 ORDER BY "org_members"."id" ASC LIMIT 1 [["org_id", 1]]
3656
+  (0.6ms) rollback transaction
@@ -5,6 +5,19 @@ RSpec.describe Org, type: :model do
5
5
  @org = Org.create!(lang_id: 1)
6
6
  end
7
7
 
8
+ describe ".branches" do
9
+ before do
10
+ @branch_other = OrgBranch.create!(org_id: @org.id + 1, org_branch_type_id: 1)
11
+ @branch = OrgBranch.create!(org_id: @org.id, org_branch_type_id: 1)
12
+ @branch2 = OrgBranch.create!(org_id: @org.id, org_branch_type_id: 1)
13
+ @branch.add OrgMember.create!(org_id: @org.id, entried_on: Time.now)
14
+ end
15
+
16
+ it "includes no member branches" do
17
+ expect(@org.branches.count).to eq(2)
18
+ end
19
+ end
20
+
8
21
  describe ".representative" do
9
22
  before do
10
23
  @member1 = OrgMember.create!(org_id: @org.id, entried_on: Time.now)
metadata CHANGED
@@ -1,7 +1,7 @@
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.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki