From d2378376e47435f71bb0c980ee60581d37060dfa Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 22 Apr 2017 20:48:48 +1200 Subject: [PATCH] Plantings validators Adding garden presence true. Checks crop presence before crop approved --- app/models/planting.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/planting.rb b/app/models/planting.rb index c7d98c7aa..f5a136b4c 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -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: {