Display all taxonomy terms, add class if term applies to current post

I was able to put this together from a similar question I found. If anyone else needs it:

<?php
$terms = get_terms( array(
    'taxonomy' => 'features',
    'hide_empty' => false
    ) );

    if (!empty($terms) && ! is_wp_error( $terms )) {
        echo '<section>';
        foreach ($terms as $term) {
            $class = has_term( $term->term_id, 'features' ) ? 'active' : 'unassigned';
            echo '<div class="term ' . $class . '"><h6>' . $term->name . '</h6>';
            echo '<div class="availability"></div>';
            echo '<p>'.$term->description.'</p></div>';
        }  
        echo '</section>';  
} ?>