Enable Rails/Validation Rubocop cop
Cop checks for the use of old-style attribute validation. Supports autocorrection which was run to fix the files concerned Closes #1414
This commit is contained in:
parent
e2a7e396a2
commit
e5587d42a2
11 changed files with 33 additions and 46 deletions
|
|
@ -13,7 +13,7 @@ class Ticket < ActiveRecord::Base
|
|||
|
||||
validates :price_cents, :price_currency, :title, presence: true
|
||||
|
||||
validates_numericality_of :price_cents, greater_than_or_equal_to: 0
|
||||
validates :price_cents, numericality: { greater_than_or_equal_to: 0 }
|
||||
|
||||
def bought?(user)
|
||||
buyers.include?(user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue