Skip to content

Commit fc7137a

Browse files
committed
No need to indent
1 parent f33f4b6 commit fc7137a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Readme.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ A simple date validator for Rails 3. Compatible with Ruby 1.8.7, 1.9.2 and
44
Rubinius 1.2.2.
55

66
```ruby
7-
$ gem sources -a http://gemcutter.org/
8-
$ gem install date_validator
7+
$ gem sources -a http://gemcutter.org/
8+
$ gem install date_validator
99
```
1010

1111
And I mean simple. In your model:
1212

1313
```ruby
14-
validates :expiration_date,
15-
:date => {:after => Proc.new { Time.now },
16-
:before => Proc.new { Time.now + 1.year } }
17-
# Using Proc.new prevents production cache issues
14+
validates :expiration_date,
15+
:date => {:after => Proc.new { Time.now },
16+
:before => Proc.new { Time.now + 1.year } }
17+
# Using Proc.new prevents production cache issues
1818
```
1919

2020
If you want to check the date against another attribute, you can pass it
2121
a Symbol instead of a block:
2222

2323
```ruby
24-
# Ensure the expiration date is after the packaging date
25-
validates :expiration_date,
26-
:date => {:after => :packaging_date}
24+
# Ensure the expiration date is after the packaging date
25+
validates :expiration_date,
26+
:date => {:after => :packaging_date}
2727
```
2828

2929
For now the available options you can use are `:after`, `:before`,
@@ -32,9 +32,9 @@ For now the available options you can use are `:after`, `:before`,
3232
If you want to specify a custom message, you can do so in the options hash:
3333

3434
```ruby
35-
validates :start_date,
36-
:date => {:after => Date.today, :message => 'must be after today'},
37-
:on => :create
35+
validates :start_date,
36+
:date => {:after => Date.today, :message => 'must be after today'},
37+
:on => :create
3838
```
3939

4040
Pretty much self-explanatory! :)

0 commit comments

Comments
 (0)