Skip to content

Commit

Permalink
Merge pull request #5599 from etiennebarrie/rails-edge-deprecations
Browse files Browse the repository at this point in the history
Fix Rails main deprecations
  • Loading branch information
rafaelfranca committed Jun 9, 2023
2 parents 1195c6f + 48e1153 commit ad172bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/orm/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
ActiveRecord::Base.include_root_in_json = true

migrate_path = File.expand_path("../../rails_app/db/migrate/", __FILE__)
if Devise::Test.rails6_and_up?
if Devise::Test.rails71_and_up?
ActiveRecord::MigrationContext.new(migrate_path).migrate
elsif Devise::Test.rails6_and_up?
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
elsif Devise::Test.rails52_and_up?
ActiveRecord::MigrationContext.new(migrate_path).migrate
Expand Down
6 changes: 5 additions & 1 deletion test/rails_app/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
config.action_controller.perform_caching = false

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
if Devise::Test.rails71_and_up?
config.action_dispatch.show_exceptions = :none
else
config.action_dispatch.show_exceptions = false
end

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
Expand Down

0 comments on commit ad172bd

Please sign in to comment.