Seeds delegate name and default_photo to their crop

This commit is contained in:
Brenda Wallace committed 2017-05-20 17:00:49 +12:00
1 parent 5f9b0890fb
commit 6e7bf11ec8
1 file changed
+2
+2
View File
@@ -9,6 +9,8 @@ class Seed < ActiveRecord::Base
default_scope { order(created_at: :desc) }
validates :crop, approved: true
delegate :name, to: :crop
delegate :default_photo, to: :crop
validates :crop, presence: { message: "must be present and exist in our database" }
validates :quantity,