Merge pull request #1326 from Br3nda/plantings-validators

Plantings validators
This commit is contained in:
Daniel O'Connor
2017-04-24 17:47:41 +09:30
committed by GitHub

View File

@@ -27,9 +27,9 @@ class Planting < ActiveRecord::Base
to: :crop,
prefix: true
validates :crop, approved: true
validates :crop, presence: { message: "must be present and exist in our database" }
validates :garden, presence: true
validates :crop, presence: true
validates :crop, approved: { message: "must be present and exist in our database" }
validates :quantity,
numericality: {