age_calculator 1.2.0 → 1.2.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 +1 -2
- data/lib/age_calculator/railtie.rb +1 -1
- data/lib/age_calculator/validator.rb +4 -0
- data/lib/age_calculator/version.rb +1 -1
- data/test/load_models.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcdb424ff53ec2b05f613927bfbd263f7172407bc6f2b5a91842f77446915b84
|
4
|
+
data.tar.gz: bbb5c4f4931a2923312072c1598438c36f71571e20cb14b7572fb3e4b9111ca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f337d1b15891667088054564b31160bbe30fad2e9e77e6a5cfb99ef550c2081b2ea09100f2400a0357003262e508813afb2ae437f15335ca3960d20bad9b635b
|
7
|
+
data.tar.gz: 76a80f440b8ba9141a69dec2f124b51690263d06ddd5d78ef58496a2b115dc8483d1cc967668a67fbb23b88ff51e22aeddf4d9fc8eb5a953e0e6dcf19c77b39b
|
data/README.md
CHANGED
@@ -49,6 +49,7 @@ For a basic usage:
|
|
49
49
|
|
50
50
|
```ruby
|
51
51
|
birthday = Date.new(2000,1,1)
|
52
|
+
|
52
53
|
ac = AgeCalculator.new(birthday)
|
53
54
|
|
54
55
|
ac.age
|
@@ -63,12 +64,10 @@ For a model with a validation on the age:
|
|
63
64
|
```ruby
|
64
65
|
class Adult < ActiveRecord::Base
|
65
66
|
validates :birthday, age: { over: 18 }
|
66
|
-
|
67
67
|
end
|
68
68
|
|
69
69
|
class Adult < ActiveRecord::Base
|
70
70
|
validates :birthday, age: { over: 18, asof: Date.today.beginning_of_year }
|
71
|
-
|
72
71
|
end
|
73
72
|
```
|
74
73
|
|
data/test/load_models.rb
CHANGED
@@ -11,7 +11,7 @@ include ActiveSupport::Testing::TimeHelpers
|
|
11
11
|
|
12
12
|
# Locale
|
13
13
|
I18n.enforce_available_locales = true
|
14
|
-
I18n.load_path +=
|
14
|
+
I18n.load_path += AgeValidator.locales
|
15
15
|
|
16
16
|
class Adult
|
17
17
|
include ActiveModel::Validations
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: age_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenn Ejima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|