• Toon Claes's avatar
    Add scope to CustomEmoji to find emoji for resource · cba2c203
    Toon Claes authored
    Award Emoji can be awarded on many things and it can be difficult to
    determine which namespace the awardable belongs to.
    
    Thus to centralize the logic that finds the custom emoji for an
    awardable, we introduce a scope on the CustomEmoji model that accepts a
    resource (being either a Project or a Group), determines it's root
    namespace, and finds all CustomEmoji for it. In combination with the
    previous commit, all the Awardable models respond to #resource_parent,
    which can be provided to this new scope.
    
    This change fixes award emoji on merge requests, epics, and issues in
    nested groups.
    
    Changelog: fixed
    cba2c203
custom_emoji.rb 1.51 KB