(Moot point since this is being removed in #976, but ...)

"extended"?  Don't you mean "overridden"?  In which case it's the subclass's responsibility to preserve the memoization.  So this would have been a better pattern:

    def role_constraints
      @role_constraints ||= role_constraints_no_caching
    end

    def role_constraints_no_caching
      {}
    end

and then subclasses only override `role_constraints_no_caching`.