I have read lib/banken/loyalty_finder.rb. It's impressive for me. So, I'd like to leave the snippet.
    def loyalty
      loyalty_name.constantize
    rescue NameError
      nil
    end
    def loyalty!
      loyalty || raise(NotDefinedError, "unable to find loyalty `#{loyalty_name}` for `#{controller_name}`")
    end
 

 
     
    
Top comments (0)