def obtain_term_check(check = nil, segments = nil, type = nil)
      term =
        if check.blank? && !segments.blank? && !segments[2].blank?
          Term.includes(:term_anatomy).where(:structured_url => "/" +  segments.drop(2).join('/')).first
        else
          Term.includes(:term_anatomy).where("name = :p OR slug = :p2 OR terms.id = :p3", { p: check.to_s, p2: check.to_s, p3: check.to_i })
        end

      term = term.where(roroacms_term_anatomies: { taxonomy: type }) if !type.blank?

      term

    end
def obtain_term_check(check = nil, segments = nil, type = nil)
      term =
        if check.blank? && !segments.blank? && !segments[2].blank?
          Term.includes(:term_anatomy).where(:structured_url => "/" +  segments.drop(2).join('/')).first
        else
          Term.includes(:term_anatomy).where("name = :p OR slug = :p2 OR terms.id = :p3", { p: check.to_s, p2: check.to_s, p3: check.to_i })
        end

      term = term.where(roroacms_term_anatomies: { taxonomy: type }) if !type.blank?

      term

    end
returns a full tag record (this is used mainly internally to retrieve the data for above functions)
 Params:
 +check+:: ID, slug, or name of the term record - if this is nil it will use the url to work out the current tag that you are viewing
 +segments+:: pass in the segments of the url
 +type+:: wether you want to check the term type against tag or category