Skip to content

Commit 8d599bc

Browse files
darbyfreydblock
authored andcommitted
Don't try to load OTR module is Rails (#67)
* Only use OTR module if defined * Added Changelog entry * updated changelog
1 parent 8978cba commit 8d599bc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* [#60](https://github.com/slack-ruby/slack-ruby-bot-server/pull/60): Log caught Standard::Error backtrace at debug-level - [@alexagranov](https://github.com/alexagranov).
66
* [#65](https://github.com/slack-ruby/slack-ruby-bot-server/pull/65): Updated Capybara and selenium-webdriver - [@dblock](https://github.com/dblock).
7+
* [#67](https://github.com/slack-ruby/slack-ruby-bot-server/pull/67): Only load the OTR::ActiveRecord::ConnectionManagement middleware when the OTR module is included. This module isn't needed when using Rails - [@darbyfrey](https://github.com/darbyfrey).
78
* Your contribution here.
89

910
#### 0.6.1 (3/29/2017)

lib/slack-ruby-bot-server/api/middleware.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def self.logger
1515

1616
def self.instance
1717
@instance ||= Rack::Builder.new do
18-
use OTR::ActiveRecord::ConnectionManagement if SlackRubyBotServer::Config.activerecord?
18+
if SlackRubyBotServer::Config.activerecord? && defined?(::OTR)
19+
use OTR::ActiveRecord::ConnectionManagement
20+
end
1921

2022
use Rack::Cors do
2123
allow do

0 commit comments

Comments
 (0)