Skip to content

Commit

Permalink
rails 7 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkamensky committed Jul 21, 2022
1 parent c081cd9 commit 3b0fbf5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/maildown/ext/action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
# This monkeypatch allows the use of `.md.erb` file extensions
# in addition to `.md+erb` and `.md`
module ActionView

if !defined?(OptimizedFileSystemResolver)
# https://github.com/codetriage/maildown/issues/59
#
# extract_handler_and_format_and_variant was removed in https://github.com/rails/rails/commit/2be8d3ebf85e26e936a7717b968737ee333d95bd
# OptimizedFileSystemResolver was removed in https://github.com/rails/rails/commit/faac734387124c6d780dbfcfdab721b2f26ce865
class OptimizedFileSystemResolver < FileSystemResolver
def extract_handler_and_format_and_variant(template)
details = @path_parser.parse(template)
[details.handler, details.format, details.variant]
end
end
end

class OptimizedFileSystemResolver
alias :original_extract_handler_and_format_and_variant :extract_handler_and_format_and_variant

Expand Down

0 comments on commit 3b0fbf5

Please sign in to comment.