Merge pull request #349 from maco/dev

Add 'root/tuber' to 'planted from:' list, for things like potatoes
This commit is contained in:
pozorvlak
2014-05-06 11:56:22 +01:00
2 changed files with 3 additions and 2 deletions

View File

@@ -43,7 +43,8 @@ class Planting < ActiveRecord::Base
'bare root plant',
'advanced plant',
'graft',
'layering'
'layering',
'root/tuber'
]
validates :planted_from, :inclusion => { :in => PLANTED_FROM_VALUES,
:message => "%{value} is not a valid planting method" },

View File

@@ -110,7 +110,7 @@ describe Planting do
it 'all valid planted_from values should work' do
['seed', 'seedling', 'cutting', 'root division',
'runner', 'bare root plant', 'advanced plant',
'graft', 'layering', 'bulb', nil, ''].each do |p|
'graft', 'layering', 'bulb', 'root/tuber', nil, ''].each do |p|
@planting = FactoryGirl.build(:planting, :planted_from => p)
@planting.should be_valid
end