trogdir_models 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trogdir/changeset.rb +8 -1
- data/lib/trogdir/person.rb +17 -0
- data/lib/trogdir_models/version.rb +1 -1
- 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: 390dc2ea0882ce33b0bef2dc3b068472ed01d155
|
|
4
|
+
data.tar.gz: d23048e4a40bcdea53235cea7094ccb2f329806a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c808066608b9a465dd873897f47a4686caf6be0eb4c5973cae54a18c7044405a503e7d9e45ec06959411ca8e4b94308a06c7e9bfc90de39a9f46bd0379b5226d
|
|
7
|
+
data.tar.gz: 91f1b5101f8c98c82476710693869d44daaad27205a225697530f29100b2d1427db29b270e9e60359622f2f95711f94b8442a2d29c2326541ede496794003e7f
|
data/lib/trogdir/changeset.rb
CHANGED
|
@@ -3,6 +3,13 @@ class Changeset
|
|
|
3
3
|
|
|
4
4
|
embeds_many :change_syncs
|
|
5
5
|
|
|
6
|
+
index created_at: -1
|
|
7
|
+
index 'change_syncs.syncinator_id' => 1
|
|
8
|
+
index 'change_syncs.started_at' => 1
|
|
9
|
+
index 'change_syncs.succeeded_at' => 1
|
|
10
|
+
index({'change_syncs._id' => 1}, unique: true)
|
|
11
|
+
index({'change_syncs.sync_logs._id' => 1}, unique: true)
|
|
12
|
+
|
|
6
13
|
after_create :create_change_syncs
|
|
7
14
|
|
|
8
15
|
alias :person :trackable_root
|
|
@@ -14,4 +21,4 @@ class Changeset
|
|
|
14
21
|
change_syncs.create syncinator: syncinator
|
|
15
22
|
end
|
|
16
23
|
end
|
|
17
|
-
end
|
|
24
|
+
end
|
data/lib/trogdir/person.rb
CHANGED
|
@@ -37,6 +37,23 @@ class Person
|
|
|
37
37
|
# Options
|
|
38
38
|
field :enabled, type: Boolean # TODO: figure out if tihs is necessary
|
|
39
39
|
|
|
40
|
+
# For sorting
|
|
41
|
+
index last_name: 1, preferred_name: 1
|
|
42
|
+
|
|
43
|
+
# For searching
|
|
44
|
+
index({uuid: 1}, unique: true)
|
|
45
|
+
index affiliations: 1
|
|
46
|
+
index first_name: 1
|
|
47
|
+
index preferred_name: 1
|
|
48
|
+
index last_name: 1
|
|
49
|
+
index display_name: 1
|
|
50
|
+
index title_name: 1
|
|
51
|
+
index department_name: 1
|
|
52
|
+
index residence_name: 1
|
|
53
|
+
index 'emails.address' => 1
|
|
54
|
+
index 'ids.identifier' => 1
|
|
55
|
+
index({'ids.identifier' => 1, 'ids.type' => 1}, unique: true)
|
|
56
|
+
|
|
40
57
|
validates :uuid, :first_name, :last_name, presence: true
|
|
41
58
|
validates :uuid, uniqueness: true
|
|
42
59
|
validates :gender, inclusion: { in: Person::GENDERS, allow_nil: true }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trogdir_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Crownoble
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-10-
|
|
11
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: api-auth
|