Fix example related to `comparison` in Active Record Validations guide

Flipped the example, to show that end_date should be greater than start_date
This commit is contained in:
vamsipavanmahesh 2022-01-09 12:28:00 +05:30
parent f63980173e
commit 2c37a6553e
1 changed files with 1 additions and 1 deletions

View File

@ -395,7 +395,7 @@ value, proc, or symbol. Any class that includes Comparable can be compared.
```ruby
class Promotion < ApplicationRecord
validates :start_date, comparison: { greater_than: :end_date }
validates :end_date, comparison: { greater_than: :start_date }
end
```