app/models/employee_allocation.rb
def validate_allocation
    unless allocation.blank?
      unless (allocation >= 0) && (allocation <= 1)
        errors.add(:allocation, "Allocation must be between 0 and 1 FTE")
      end
    end
  end
# Validates that the allocation is within proper range
Validates that the allocation is within proper range
Validates that the allocation is within proper range
def validate_allocation
    unless allocation.blank?
      unless (allocation >= 0) && (allocation <= 1)
        errors.add(:allocation, "Allocation must be between 0 and 1 FTE")
      end
    end
  end
def validate_allocation unless allocation . blank? unless ( allocation >= 0 ) && ( allocation <= 1 ) errors . add ( :allocation , "Allocation must be between 0 and 1 FTE" ) end end end
Validates that the allocation is within proper range
Validates that the allocation is within proper range