human
Solve the following python programming problem given the following code:
def _get_referenced_models(self, rules) : 
    '
        Reduces the number of queries to be made to the DB by creating sets of Actions, Triggers
        and TriggerTypes.
        ' 
    action_refs = set () 
    trigger_refs = set () 
    trigger_type_refs = set () 
    for rule in rules : 
        action_refs.add (trigger_dbs.action ['ref']) 
        trigger_refs.add (rule.trigger ['ref']) 
        trigger_type_refs.add (rule.trigger ['type']) 
action_by_refs = { 
        
} 
    trigger_by_refs = { 
        
} 
    trigger_type_by_refs = { 
        
} 
    def ref_query_args(ref) : 
        return { 
            'ref' : ref, 
} 
def name_pack_query_args(ref) : 
        resource_ref = ResourceReference.from_string_reference (ref = ref) 
        return { 
            'name' : resource_ref.name, 
            'pack' : resource_ref.pack, 
} 
action_dbs = self._get_entities (model_persistence = Action, refs = action_refs, query_args = ref_query_args) 
    for action_db in action_dbs : 
        action_by_refs [action_db.ref] = action_db 
trigger_dbs = self._get_entities (model_persistence = Trigger, refs = trigger_refs, query_args = name_pack_query_args) 
    for trigger_db in trigger_dbs : 
        trigger_by_refs [trigger_db.get_reference ().ref] = trigger_db 
trigger_type_dbs = self._get_entities (model_persistence = TriggerType, refs = trigger_type_refs, query_args = name_pack_query_args) 
    for trigger_type_db in trigger_type_dbs : 
        trigger_type_by_refs [trigger_type_db.get_reference ().ref] = trigger_type_db 
return (action_by_refs, trigger_by_refs, trigger_type_by_refs) 

    
    

    Fix the buggy line: action_refs.add (trigger_dbs.action ['ref'])
assistant
#Here is Python code to fix the buggy line: action_refs.

action_refs.add (rule.action ['ref'])