rails-schema-validations 0.5 → 0.5.1
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.
- data/README +12 -8
- metadata +3 -2
data/README
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
|
1
|
+
Add validations to your models automatically based on the schema constraints.
|
2
|
+
Place this one line in your model:
|
2
3
|
|
3
4
|
validations_from_schema
|
4
5
|
|
5
|
-
| schema type | rails validation |
|
6
|
-
|-------------|---------------------------|
|
7
|
-
| non-null | validates_presence_of |
|
8
|
-
| limit | validates_length_of |
|
9
|
-
| integer | validates_numericality_of |
|
10
|
-
| float | validates_numericality_of |
|
11
6
|
|
7
|
+
| schema type | rails validation | extra |
|
8
|
+
|-------------|---------------------------|---------------------------|
|
9
|
+
| non-null | validates_presence_of | |
|
10
|
+
| string | validates_length_of | :limit |
|
11
|
+
| integer | validates_numericality_of | :only_integer, :less_than |
|
12
|
+
| float | validates_numericality_of | |
|
12
13
|
|
13
|
-
|
14
|
+
|
15
|
+
Tested on MySQL.
|
16
|
+
Does not detect what database is being used.
|
17
|
+
This gem may have problems on other databases, particularly Sqlite.
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-schema-validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Greg Weber
|