mumukit-platform 5.0.1 → 5.1.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1afd814d055b5a9ce037f53e475a2f1122d60fc64cb7dc66589707a70f83c72
|
4
|
+
data.tar.gz: 9ab5ac143a1cbdd5e0ad1154da7df5d6a610d353125080f3fa713760b7d622de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6634d7a63968fd6ec802be5c4469662716b5a5a9659e93041069a484791367ea8f8b09d8219d395f9e7683bbb4171b8db8a4fe35c3293f1981642f010caeb90f
|
7
|
+
data.tar.gz: 86aa9223741d003012de4b5c1ac88cc6d2b8a2cb2ca23a1fd535b0e7a01c4475849c3c7fe4cdce40610667d85786eb6ca8bd91fa826a5c584ee6d6af199a570d
|
@@ -23,5 +23,20 @@ module Mumukit::Platform::Organization
|
|
23
23
|
def self.find_by_name!(name)
|
24
24
|
Mumukit::Platform.organization_class.find_by_name!(name)
|
25
25
|
end
|
26
|
+
|
27
|
+
|
28
|
+
## Name validation
|
29
|
+
|
30
|
+
def self.valid_name?(name)
|
31
|
+
!!(name =~ anchored_valid_name_regex)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.anchored_valid_name_regex
|
35
|
+
/\A#{valid_name_regex}\z/
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.valid_name_regex
|
39
|
+
/([-a-z0-9_]+(\.[-a-z0-9_]+)*)?/
|
40
|
+
end
|
26
41
|
end
|
27
42
|
|
@@ -21,7 +21,7 @@ module Mumukit::Platform::WebFramework
|
|
21
21
|
def self.tenant_scope_options
|
22
22
|
{
|
23
23
|
defaults: { tenant: lazy_string { Mumukit::Platform.current_organization_name } },
|
24
|
-
constraints: { tenant: Mumukit::Platform::Organization
|
24
|
+
constraints: { tenant: Mumukit::Platform::Organization.valid_name_regex }
|
25
25
|
}
|
26
26
|
end
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-nuntius
|