1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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
```