Skip to content

Commit

Permalink
Merge pull request phatworx#30 from raventid/patch-1
Browse files Browse the repository at this point in the history
updates ruby symbol syntax in README.md
  • Loading branch information
balexand committed Sep 16, 2015
2 parents ef9c091 + 2ba2c51 commit 738d73a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ bundle install
Then add the following to your model:

```ruby
validates :my_email_attribute, :email => true
validates :my_email_attribute, email: true
```

## Strict mode

In order to have stricter validation (according to http://www.remote.org/jochen/mail/info/chars.html) enable strict mode. You can do this globally by adding the following to your Gemfile:

```ruby
gem 'email_validator', :require => 'email_validator/strict'
gem 'email_validator', require: 'email_validator/strict'
```

Or you can do this in a specific `validates` call:

```ruby
validates :my_email_attribute, :email => {:strict_mode => true}
validates :my_email_attribute, email: {strict_mode: true}
```

## Validation outside a model
Expand All @@ -48,7 +48,7 @@ EmailValidator.valid?('[email protected]') # boolean
### Strict mode

```ruby
EmailValidator.regexp(:strict_mode => true)
EmailValidator.regexp(strict_mode: true)
```

## Thread safety
Expand Down

0 comments on commit 738d73a

Please sign in to comment.