validates_timeliness 5.0.0.beta2 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1a33066804513d38555d4df30d3dfbad7014c62d8957ad1ebf99c14adb90beb
4
- data.tar.gz: 56761810344acb7c8ff581e255ba552d0068aef5502fd273738f63c0210e6072
3
+ metadata.gz: 2a87264d54db8505c8dcbeff59eda9c7e091d07942c97de3f34e7f9fc2f465c8
4
+ data.tar.gz: 504d91a6c0af936ffd864180c4e174521598c13f4c7774966b86808138e6fc51
5
5
  SHA512:
6
- metadata.gz: 2301742287dd48a2736f3e0d5d0c53668a24dbefbec14fe6634a30ea6623ec1b8f444585fef45f641cdc0796f505ca83dc491d7e325d99e9168591b2b1a36566
7
- data.tar.gz: 452facc79441af9ec3baad06ab9cd4d2d0a0e1df3e4977200db615e949fcad117b91661641230137422d28483cc8bb48d4580eec4dce90a0c41a16e81ab82ee0
6
+ metadata.gz: 335b52bbbd66dd0a2e0a5ca1db25637eb2afb9007418d5a035342de756f391325170ec62fce16f422d30f80ffdf0b2f12e7fdb3fbbcecfb82d3ebbed2e6e2b25
7
+ data.tar.gz: cc3000300065dac0b74164ce5491f541fd338fa7649a6a0da722ae4179de48a7c46ec1f6c47aee2a91769058e0e7e2a2565d1d0b1b3c29d8495f5a9814d94041
data/README.rdoc CHANGED
@@ -49,21 +49,21 @@ NOTE: You may wish to enable the plugin parser and the extensions to start. Plea
49
49
 
50
50
  validates_datetime :occurred_at
51
51
 
52
- validates_date :date_of_birth, :before => lambda { 18.years.ago },
53
- :before_message => "must be at least 18 years old"
52
+ validates_date :date_of_birth, before: lambda { 18.years.ago },
53
+ before_message: "must be at least 18 years old"
54
54
 
55
- validates_datetime :finish_time, :after => :start_time # Method symbol
55
+ validates_datetime :finish_time, after: :start_time # Method symbol
56
56
 
57
- validates_date :booked_at, :on => :create, :on_or_after => :today # See Restriction Shorthand.
57
+ validates_date :booked_at, on: :create, on_or_after: :today # See Restriction Shorthand.
58
58
 
59
- validates_time :booked_at, :between => ['9:00am', '5:00pm'] # On or after 9:00AM and on or before 5:00PM
60
- validates_time :booked_at, :between => '9:00am'..'5:00pm' # The same as previous example
61
- validates_time :booked_at, :between => '9:00am'...'5:00pm' # On or after 9:00AM and strictly before 5:00PM
59
+ validates_time :booked_at, between: ['9:00am', '5:00pm'] # On or after 9:00AM and on or before 5:00PM
60
+ validates_time :booked_at, between: '9:00am'..'5:00pm' # The same as previous example
61
+ validates_time :booked_at, between: '9:00am'...'5:00pm' # On or after 9:00AM and strictly before 5:00PM
62
62
 
63
- validates_time :breakfast_time, :on_or_after => '6:00am',
64
- :on_or_after_message => 'must be after opening time',
65
- :before => :lunchtime,
66
- :before_message => 'must be before lunch time'
63
+ validates_time :breakfast_time, on_or_after: '6:00am',
64
+ on_or_after_message: 'must be after opening time',
65
+ before: :lunchtime,
66
+ before_message: 'must be before lunch time'
67
67
 
68
68
 
69
69
  == Usage
@@ -72,14 +72,14 @@ To validate a model with a date, time or datetime attribute you just use the
72
72
  validation method
73
73
 
74
74
  class Person < ActiveRecord::Base
75
- validates_date :date_of_birth, :on_or_before => lambda { Date.current }
75
+ validates_date :date_of_birth, on_or_before: lambda { Date.current }
76
76
  # or
77
- validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.current }, :type => :date}
77
+ validates :date_of_birth, timeliness: {on_or_before: lambda { Date.current }, type: :date}
78
78
  end
79
79
 
80
80
  or even on a specific record, per ActiveModel API.
81
81
 
82
- @person.validates_date :date_of_birth, :on_or_before => lambda { Date.current }
82
+ @person.validates_date :date_of_birth, on_or_before: lambda { Date.current }
83
83
 
84
84
 
85
85
  The list of validation methods available are as follows:
@@ -206,14 +206,14 @@ plugin allows you to use shorthand symbols for often used relative times or date
206
206
 
207
207
  Just provide the symbol as the option value like so:
208
208
 
209
- validates_date :birth_date, :on_or_before => :today
209
+ validates_date :birth_date, on_or_before: :today
210
210
 
211
211
  The :today symbol is evaluated as <tt>lambda { Date.today }</tt>. The :now and :today
212
212
  symbols are pre-configured. Configure your own like so:
213
213
 
214
214
  # in the setup block
215
215
  config.restriction_shorthand_symbols.update(
216
- :yesterday => lambda { 1.day.ago }
216
+ yesterday: lambda { 1.day.ago }
217
217
  )
218
218
 
219
219
 
@@ -1,3 +1,3 @@
1
1
  module ValidatesTimeliness
2
- VERSION = '5.0.0.beta2'
2
+ VERSION = '5.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_timeliness
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta2
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-12 00:00:00.000000000 Z
11
+ date: 2021-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timeliness
@@ -99,9 +99,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">"
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.3.1
104
+ version: '0'
105
105
  requirements: []
106
106
  rubygems_version: 3.0.3
107
107
  signing_key: