Skip to content

Commit

Permalink
Rails 7.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed Sep 21, 2023
1 parent 2cb3f2b commit 9a196d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
katalyst-koi (4.1.0)
katalyst-koi (4.1.1)
bcrypt
importmap-rails
katalyst-content
Expand Down
5 changes: 2 additions & 3 deletions lib/koi/middleware/url_redirect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ def initialize(app)
def call(env)
status, headers, body = @app.call(env)

current_path = env["REQUEST_PATH"]
current_path = env["REQUEST_URI"]

if status.to_i == 404 && current_path.exclude?("mini-profiler-resources") &&
(new_path = find_redirect(current_path))
if status.to_i == 404 && (new_path = find_redirect(current_path))
request = ActionDispatch::Request.new(env)

# Close the body as we will not use it for a 301 redirect
Expand Down
2 changes: 1 addition & 1 deletion lib/koi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Koi
VERSION = "4.1.0"
VERSION = "4.1.1"
end
2 changes: 1 addition & 1 deletion lib/tasks/dummy.thor
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Dummy < Thor
# Re-generate database using locally installed migrations
def reset_database(migrate: false)
if migrate
run("rails app:db:drop app:db:prepare app:db:schema:dump app:db:schema:load")
run("rails app:db:drop app:db:create app:db:migrate app:db:schema:dump app:db:schema:load")
else
run("rails app:db:reset")
end
Expand Down

0 comments on commit 9a196d0

Please sign in to comment.