active_date_range 0.5.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -1
- data/lib/active_date_range/date_range.rb +3 -1
- data/lib/active_date_range/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca443decbae6f02f3b89ec4177942c925eb20fb00fe70b809d96d0573a4d332a
|
|
4
|
+
data.tar.gz: 915e82bd0b6449839876d7a193ad2430bd76bb810bedf31cd8b45c6c0abdabbd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff38e2d4be8755802f6ef51cb487366bd81341dd62948b38e463f6c583920fd5c4ec344052f3d9a0588bd60c8d04b25a12a41c8f0020dca3f80d879daea59120
|
|
7
|
+
data.tar.gz: e9dc0f34eca52082773c9c6fa2a4609af3955a4731c56ded61a5d94af357185348f98b724b029eb4b5e31e08469c27c6f860e7b07bd4ef712a49cf42be6247a3
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 0.5.1
|
|
2
|
+
|
|
3
|
+
* Return `Float::INFINITY` from `size` for boundless ranges, making `validates_length_of` correctly reject them.
|
|
4
|
+
|
|
5
|
+
*Edwin Vlieg*
|
|
6
|
+
|
|
1
7
|
## 0.5.0
|
|
2
8
|
|
|
3
9
|
* Add `size` and `length` methods that return an `ActiveSupport::Duration`, compatible with `validates_length_of`:
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
active_date_range (0.5.
|
|
4
|
+
active_date_range (0.5.1)
|
|
5
5
|
activesupport (~> 8.0)
|
|
6
6
|
i18n (~> 1.6)
|
|
7
7
|
|
|
@@ -54,6 +54,7 @@ GEM
|
|
|
54
54
|
erb (5.0.3)
|
|
55
55
|
erubi (1.13.1)
|
|
56
56
|
ffi (1.17.2)
|
|
57
|
+
ffi (1.17.2-x86_64-linux-gnu)
|
|
57
58
|
formatador (1.2.1)
|
|
58
59
|
reline
|
|
59
60
|
guard (2.19.1)
|
|
@@ -97,6 +98,8 @@ GEM
|
|
|
97
98
|
nokogiri (1.18.10)
|
|
98
99
|
mini_portile2 (~> 2.8.2)
|
|
99
100
|
racc (~> 1.4)
|
|
101
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
|
102
|
+
racc (~> 1.4)
|
|
100
103
|
notiffany (0.1.3)
|
|
101
104
|
nenv (~> 0.1)
|
|
102
105
|
shellany (~> 0.0)
|
|
@@ -141,7 +141,9 @@ module ActiveDateRange
|
|
|
141
141
|
# validates_length_of :period, maximum: 6.months
|
|
142
142
|
# validates_length_of :period, maximum: 30.days
|
|
143
143
|
def size
|
|
144
|
-
|
|
144
|
+
return Float::INFINITY if boundless?
|
|
145
|
+
|
|
146
|
+
days.days
|
|
145
147
|
end
|
|
146
148
|
|
|
147
149
|
alias :length :size
|