spicy_validation 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +21 -25
- data/lib/spicy_validation/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df694a3fd2d00347e95cfc64ab1d0133755416c00ad03a32621eda654a0a01ed
|
4
|
+
data.tar.gz: 01475f210130e3a320d100030027518c012e2c179dd32286b20d7c3333cbfba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7432ca4cae8930fd5b36b494a48c1b5ec6067f06370481d8b370c51d2d000f5f3df8ebe8bdab7919dffd74757762f5b727425f49c28092f74ab4d9901bd3ceb9
|
7
|
+
data.tar.gz: 0e3ce4286c873ee342f4beb8fc22dcb51dc86575540fb6196bb61c7c50dfb88a4347920dfdbe62b5286d56c9b207d4dae34deb782751f4512c59d4748fbdd951
|
data/README.md
CHANGED
@@ -33,41 +33,37 @@ Type a number you wanna generate validation > ex) 0
|
|
33
33
|
|
34
34
|
## Example
|
35
35
|
|
36
|
-
```
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
36
|
+
```sql
|
37
|
+
+------------+--------------+------+-----+---------+----------------+
|
38
|
+
| Field | Type | Null | Key | Default | Extra |
|
39
|
+
+------------+--------------+------+-----+---------+----------------+
|
40
|
+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
|
41
|
+
| name | varchar(255) | NO | | NULL | |
|
42
|
+
| message | varchar(255) | YES | | NULL | |
|
43
|
+
| age | int(11) | NO | | NULL | |
|
44
|
+
| score | int(11) | YES | | NULL | |
|
45
|
+
| premium | tinyint(1) | YES | | NULL | |
|
46
|
+
| created_at | datetime(6) | NO | | NULL | |
|
47
|
+
| updated_at | datetime(6) | NO | | NULL | |
|
48
|
+
+------------+--------------+------+-----+---------+----------------+
|
49
|
+
```
|
51
50
|
|
51
|
+
```ruby
|
52
52
|
# app/models/user.rb
|
53
53
|
class User < ApplicationRecord
|
54
|
-
|
55
|
-
validates :
|
56
|
-
validates :
|
57
|
-
validates :score, presence: true, numericality: true, allow_nil: true
|
58
|
-
validates :premium, presence: true
|
59
|
-
validates_uniqueness_of :age, scope: :name
|
54
|
+
validates :name, presence: true
|
55
|
+
validates :age, presence: true, numericality: true
|
56
|
+
validates :score, numericality: true, allow_nil: true
|
60
57
|
end
|
61
|
-
|
62
|
-
|
63
58
|
```
|
59
|
+
|
64
60
|
## Development
|
65
61
|
|
66
62
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
67
63
|
|
68
64
|
## Contributing
|
69
65
|
|
70
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
66
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ono-max/spicy_validation. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ono-max/spicy_validation/blob/master/CODE_OF_CONDUCT.md).
|
71
67
|
|
72
68
|
## License
|
73
69
|
|
@@ -75,7 +71,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
75
71
|
|
76
72
|
## Code of Conduct
|
77
73
|
|
78
|
-
Everyone interacting in the SpicyValidation project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
74
|
+
Everyone interacting in the SpicyValidation project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ono-max/spicy_validation/blob/master/CODE_OF_CONDUCT.md).
|
79
75
|
|
80
76
|
## Reference
|
81
77
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spicy_validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naoto Ono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -145,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
|
149
|
-
rubygems_version: 2.7.6.2
|
148
|
+
rubygems_version: 3.2.11
|
150
149
|
signing_key:
|
151
150
|
specification_version: 4
|
152
151
|
summary: SpicyValidation generate validation from database schema.
|