Skip to content

Commit

Permalink
rails 5.2 compat (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Feb 17, 2024
1 parent 8bb0523 commit dba1b49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/parallel_tests/tasks.rb
Expand Up @@ -138,7 +138,8 @@ def for_each_database(&block)
# Use nil to represent all databases
block&.call(nil)

return unless defined?(ActiveRecord)
# skip if not rails or old rails version
return if !defined?(ActiveRecord::Tasks::DatabaseTasks) || !ActiveRecord::Tasks::DatabaseTasks.respond_to?(:for_each)

ActiveRecord::Tasks::DatabaseTasks.for_each(configured_databases) do |name|
block&.call(name)
Expand Down

0 comments on commit dba1b49

Please sign in to comment.