subdomain_validation 0.2.0 → 1.0.0
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/README.md +10 -5
- data/lib/subdomain_validation/version.rb +1 -1
- 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: 0ab7834b70709fc8303b9a6d793b19593cb23007
|
4
|
+
data.tar.gz: 56c4d65c99429bc045b56fbc45ab0a218deb4cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc6464baaf8a7385745fe3ded75c71748ff521ed1e9274b9dd86f2b4e7c0971c84aae1937028ae9d8e14930b6b0da0364c6431756615ed953d274f35787f60a7
|
7
|
+
data.tar.gz: 18db4e1ec22c0329fcf92fe6083a8c71e3f810a273317f69e587c1126260c6ca9837d4808578be7890d8c5ffa2a06143caf1ae5f1c68aebf4dff49a4eee50d3a
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ Run bundler.
|
|
14
14
|
|
15
15
|
## How to use
|
16
16
|
|
17
|
-
Add `SubdomainValidation` module to a model.
|
17
|
+
First, Add `SubdomainValidation` module to a model.
|
18
18
|
|
19
19
|
```rb
|
20
20
|
class User < ActiveRecord::Base
|
@@ -22,7 +22,7 @@ class User < ActiveRecord::Base
|
|
22
22
|
end
|
23
23
|
```
|
24
24
|
|
25
|
-
|
25
|
+
Next, add `validates` method on a column in the model.
|
26
26
|
|
27
27
|
```rb
|
28
28
|
class User < ActiveRecord::Base
|
@@ -72,10 +72,15 @@ end
|
|
72
72
|
### Options
|
73
73
|
|
74
74
|
- reserved_name
|
75
|
+
- Values: String Array or False
|
75
76
|
- String Array
|
76
|
-
|
77
|
-
|
78
|
-
|
77
|
+
- You can reserve the words which can not be taken.
|
78
|
+
- If use this option, then default reserved_name will be disabled.
|
79
|
+
- `validates :username, subdomain: { reserved_name: %w(www blog admin) }`
|
80
|
+
- False
|
81
|
+
- You can disable reserved_name feature.
|
82
|
+
- If use this option, then default reserved_name will be disabled.
|
83
|
+
- `validates :username, subdomain: { reserved_name: false }`
|
79
84
|
|
80
85
|
### I18n
|
81
86
|
|