def obtain_all_category_ids(articleid = nil)
      if article_id.blank?
        Term.joins(:term_anatomy).where(roroacms_term_anatomies: { taxonomy: 'category' }).pluck(:id)
      else
        # get via the posts
        Term.joins(:term_anatomy, :posts).where(posts: {id: articleid}, roroacms_term_anatomies: { taxonomy: 'category' }).pluck(:id)
      end
    end
def obtain_all_category_ids(articleid = nil)
      if article_id.blank?
        Term.joins(:term_anatomy).where(roroacms_term_anatomies: { taxonomy: 'category' }).pluck(:id)
      else
        # get via the posts
        Term.joins(:term_anatomy, :posts).where(posts: {id: articleid}, roroacms_term_anatomies: { taxonomy: 'category' }).pluck(:id)
      end
    end
CATEGORY functions 
 returns an array of all the ids that are either in the system or attached to the given post
 Params:
 +articleid+:: ID of the article you want to get all the categories for - if this is nil it will return all the categories in the system