Skip to content

Commit

Permalink
Allow use of AR middleware outside of Rails proper, fixes #3787
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Mar 13, 2018
1 parent 8a4926c commit aa46700
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ HEAD
- Fix crash on Ctrl-C in Windows [#3775, Bernica]
- Remove `freeze` calls on String constants. This is superfluous with Ruby
2.3+ and `frozen_string_literal: true`. [#3759]
- Fix use of AR middleware outside of Rails [#3787]

5.1.1
-----------
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/middleware/server/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ActiveRecord
def initialize
# With Rails 5+ we must use the Reloader **always**.
# The reloader handles code loading and db connection management.
if ::Rails::VERSION::MAJOR >= 5
if defined?(::Rails) && ::Rails::VERSION::MAJOR >= 5
raise ArgumentError, "Rails 5 no longer needs or uses the ActiveRecord middleware."
end
end
Expand Down

0 comments on commit aa46700

Please sign in to comment.