datoki 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -1
- data/VERSION +1 -1
- data/lib/datoki.rb +322 -247
- data/specs/0010-Datoki.db.new.rb +31 -0
- data/specs/0010-Datoki.db.rb +67 -0
- data/specs/0010-Numeric.rb +66 -0
- data/specs/0010-Numeric_db.rb +28 -0
- data/specs/0010-href.rb +75 -0
- data/specs/0010-html_escape.rb +44 -0
- data/specs/0010-no_type.rb +14 -0
- data/specs/0010-schema_conflict.rb +38 -0
- data/specs/0010-varchar.rb +98 -0
- data/specs/0010-varchar_db.rb +33 -0
- data/specs/0020-clean.rb +58 -0
- data/specs/0020-on.rb +64 -0
- metadata +14 -3
- data/specs/datoki.rb +0 -556
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 397ce11ce7b856de259198ac22633a0624fa971e
|
4
|
+
data.tar.gz: bb53e10c2760b096e7a56fee2a89fc93cbac2b22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48265561168ce8dd52640b1dfd5b2a709cc6201e052922b3a664377590b4ca6b1b8665f704b44a1c00811d030823cef13302bc698998e106ac6889f62decea2d
|
7
|
+
data.tar.gz: 7a0ab44c107a3abea4d8173fed8e54a590e7ba9453aca9c27959b7547c2919141c53da09fdea10bfcde9e0c6a69f126a8159e04fcf2e7d8b570b202e69d53fa3
|
data/README.md
CHANGED
@@ -9,5 +9,33 @@ A Ruby gem for managing validation and records using PostgreSQL.
|
|
9
9
|
|
10
10
|
## Usage
|
11
11
|
|
12
|
-
|
12
|
+
```ruby
|
13
|
+
class Computer
|
14
|
+
include Datoki
|
15
|
+
|
16
|
+
field(:id) { primary_key }
|
17
|
+
field(:name) { varchar }
|
18
|
+
field(:desc) { text nil, 1, 955 }
|
19
|
+
|
20
|
+
on :create_or_update? do
|
21
|
+
|
22
|
+
on :create? do
|
23
|
+
clean :name!, :desc
|
24
|
+
end
|
25
|
+
|
26
|
+
on :update? do
|
27
|
+
|
28
|
+
clean :name, :desc
|
29
|
+
|
30
|
+
on :special? do
|
31
|
+
skip :db
|
32
|
+
# do special processing
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end # === :create_or_update?
|
37
|
+
|
38
|
+
|
39
|
+
end # === class
|
40
|
+
```
|
13
41
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|