trackington 0.2.4.pre → 0.2.5.pre
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/trackington/app/projects.rb +16 -0
- data/lib/trackington/db/models/project.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 595e22caf77fb411ceb1aa27d8fd73a5e1bf929f
|
|
4
|
+
data.tar.gz: 52d08883a42468fbdc5dfb322443af5fe4276599
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93ba73df03e7d956b7a7f8a832f6f5e7bb2adee346e776fae54c862ef4ae9d1099dfcf9482ee7cdc2389af3758b92c6fca3b9bd7b81396fee28c5f23b04323ba
|
|
7
|
+
data.tar.gz: f5e9a53fb19bc4dae6ce1a83b2f900c738110ee03f5b97c27fdbf0aa8074b97248735976ace9dc6f52b6cf1e2b8bf1f25424e263a3328f6292775ed078129576
|
|
@@ -133,6 +133,12 @@ module Trackington
|
|
|
133
133
|
role.role_type == type
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
+
def users
|
|
137
|
+
Models::Project.find(@id).project_roles.map do |role|
|
|
138
|
+
ProjectRole.new(role)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
136
142
|
private
|
|
137
143
|
|
|
138
144
|
def check_user_role(user_id, type)
|
|
@@ -144,4 +150,14 @@ module Trackington
|
|
|
144
150
|
fail 'User not in role.' if project_role.role_type != type
|
|
145
151
|
end
|
|
146
152
|
end
|
|
153
|
+
|
|
154
|
+
class ProjectRole
|
|
155
|
+
attr_reader :user_id, :user_email, :type
|
|
156
|
+
|
|
157
|
+
def initialize(project_role)
|
|
158
|
+
@user_id = project_role.user_id
|
|
159
|
+
@user_email = project_role.user.email
|
|
160
|
+
@type = project_role.role_type
|
|
161
|
+
end
|
|
162
|
+
end
|
|
147
163
|
end
|