mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-05 07:01:03 -05:00
reason_for_rejection is required if marked as rejected
This commit is contained in:
@@ -35,6 +35,8 @@ class Crop < ActiveRecord::Base
|
||||
},
|
||||
:if => :approved?
|
||||
|
||||
validates :reason_for_rejection, :presence => true, :if => :rejected?
|
||||
|
||||
def to_s
|
||||
return name
|
||||
end
|
||||
@@ -114,6 +116,10 @@ class Crop < ActiveRecord::Base
|
||||
approval_status == "approved"
|
||||
end
|
||||
|
||||
def rejected?
|
||||
approval_status == "rejected"
|
||||
end
|
||||
|
||||
# Crop.interesting
|
||||
# returns a list of interesting crops, for use on the homepage etc
|
||||
def Crop.interesting
|
||||
|
||||
Reference in New Issue
Block a user