we_bridge_rails_engine_orgs 0.1.10 → 0.1.11

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: c626dd37559e7522d368cf9c99122f11613498da
4
- data.tar.gz: 79f81e952ce4e8a46913c47d48b6f716f9adfe83
3
+ metadata.gz: fb35709684f5ec87c992adc48f770df73f9134ce
4
+ data.tar.gz: 8960cfd168c44207dc5a9546d697ec38e405ff4d
5
5
  SHA512:
6
- metadata.gz: 866d80c0bd190f88d7beb9f774502cd046f36bd1049cad281c8862d3d2adfcb01bc619b028a2be8dd63354323da9731cd01f8f0696ce2783f416acf93d6b114c
7
- data.tar.gz: d239cbecd293be50d9215d52e1b1653605cd4bb7f07729791db35066e4d77ec5965c68675c275c322083a9d4b6d28a26f3fc21ae82f689c2319794e717e8b2f6
6
+ metadata.gz: 3507084bffa0e03517c01ef9aefad93e869545853978e1cfc0e0f77470a99f0e8ba0a48ec20aebbef303270a9cfd826478b9d171de3786c893dfa6860c493ba6
7
+ data.tar.gz: b36bf6df0eb6dfec57e02600a005d167ec51867a88de6d47760cfe107b724091cf3ba4a549ecab3cc8cc0d2519a61fd4e1b2dae52fb2b31602b7c27f6301dde9
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.10)
4
+ we_bridge_rails_engine_orgs (0.1.11)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
@@ -25,7 +25,7 @@ class OrgMember < ActiveRecord::Base
25
25
  set_input_options :sex, min: -1, max: 1
26
26
 
27
27
  default_scope ->(){ where(retired_on: nil) }
28
- scope :without_secret, ->(){ where(secret: false) }
28
+ scope :without_secret, ->(){ where(private: false) }
29
29
 
30
30
  def others
31
31
  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.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -5432,3 +5432,38 @@ Completed 200 OK in 38ms (Views: 24.8ms | ActiveRecord: 0.8ms)
5432
5432
   (0.0ms) SELECT MIN("org_director_types"."position") FROM "org_director_types" WHERE "org_director_types"."org_id" = ? [["org_id", 1]]
5433
5433
  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]]
5434
5434
   (0.8ms) rollback transaction
5435
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
5436
+  (0.1ms) begin transaction
5437
+  (0.1ms) SAVEPOINT active_record_1
5438
+ SQL (1.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-16 16:06:30.100442"], ["updated_at", "2015-12-16 16:06:30.100442"]]
5439
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5440
+  (0.1ms) SAVEPOINT active_record_1
5441
+ SQL (0.9ms) INSERT INTO "org_members" ("org_id", "entried_on", "retired_on", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-17"], ["retired_on", "2015-12-17"], ["created_at", "2015-12-16 16:06:30.130039"], ["updated_at", "2015-12-16 16:06:30.130039"]]
5442
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5443
+  (0.1ms) SAVEPOINT active_record_1
5444
+ SQL (0.2ms) UPDATE "org_members" SET "retired_on" = ?, "updated_at" = ? WHERE "org_members"."id" = ? [["retired_on", nil], ["updated_at", "2015-12-16 16:06:30.133913"], ["id", 1]]
5445
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5446
+ OrgMember Load (0.2ms) 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]]
5447
+  (0.6ms) rollback transaction
5448
+  (0.1ms) begin transaction
5449
+  (0.1ms) SAVEPOINT active_record_1
5450
+ SQL (0.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-16 16:06:30.175519"], ["updated_at", "2015-12-16 16:06:30.175519"]]
5451
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5452
+  (0.1ms) SAVEPOINT active_record_1
5453
+ 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-17"], ["retired_on", "2015-12-17"], ["created_at", "2015-12-16 16:06:30.178472"], ["updated_at", "2015-12-16 16:06:30.178472"]]
5454
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5455
+  (0.1ms) SELECT COUNT(*) FROM "org_members" WHERE "org_members"."retired_on" IS NULL AND "org_members"."org_id" = ? [["org_id", 1]]
5456
+  (0.9ms) rollback transaction
5457
+  (0.1ms) begin transaction
5458
+  (0.1ms) SAVEPOINT active_record_1
5459
+ SQL (0.4ms) INSERT INTO "orgs" ("lang_id", "created_at", "updated_at") VALUES (?, ?, ?) [["lang_id", 1], ["created_at", "2015-12-16 16:06:30.184716"], ["updated_at", "2015-12-16 16:06:30.184716"]]
5460
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5461
+  (0.1ms) SAVEPOINT active_record_1
5462
+ SQL (0.4ms) INSERT INTO "org_members" ("org_id", "entried_on", "private", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-17"], ["private", "t"], ["created_at", "2015-12-16 16:06:30.188526"], ["updated_at", "2015-12-16 16:06:30.188526"]]
5463
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5464
+  (0.1ms) SAVEPOINT active_record_1
5465
+ SQL (0.3ms) INSERT INTO "org_members" ("org_id", "entried_on", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["org_id", 1], ["entried_on", "2015-12-17"], ["created_at", "2015-12-16 16:06:30.190992"], ["updated_at", "2015-12-16 16:06:30.190992"]]
5466
+  (0.1ms) RELEASE SAVEPOINT active_record_1
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
+ 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
+  (0.8ms) rollback transaction
@@ -19,4 +19,16 @@ RSpec.describe OrgMember, type: :model do
19
19
  expect(@org.members.count).to eq(0)
20
20
  end
21
21
  end
22
+
23
+ context ".without_secret" do
24
+ before do
25
+ @member = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, private: true)
26
+ @member2 = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, private: false)
27
+ end
28
+ it "hit only one user" do
29
+ res = @org.members.without_secret
30
+ expect(res.count).to eq(1)
31
+ expect(res.first.id).to eq(@member2.id)
32
+ end
33
+ end
22
34
  end
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.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki