def get_rules_with_trigger_ref(trigger_ref=None, enabled=True):
    """
    Get rules in DB corresponding to given trigger_ref as a string reference.

    :param trigger_ref: Reference to trigger.
    :type trigger_ref: ``str``

    :rtype: ``list`` of ``RuleDB``
    """

    if not trigger_ref:
        return None

    LOG.debug("Querying rules with trigger %s", trigger_ref)
    return Rule.query(trigger=trigger_ref, enabled=enabled)

    Get rules in DB corresponding to given trigger_ref as a string reference.

    :param trigger_ref: Reference to trigger.
    :type trigger_ref: ``str``

    :rtype: ``list`` of ``RuleDB``
    
st2common/st2common/services/rules.py