1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-08 11:55:51 +03:00
ActionDispatch::Testing::Integration requires smth else and
defines Rails, so had to change `defined?(Rails)` all over the code.
Этот коммит содержится в:
Max Melentiev
2016-11-16 14:16:45 +03:00
родитель 5c299887bb
Коммит 0c9a4a5fa0
7 изменённых файлов: 159 добавлений и 24 удалений

Просмотреть файл

@@ -20,7 +20,7 @@ module Telegram
def bot_poller_mode?
return @bot_poller_mode if defined?(@bot_poller_mode)
@bot_poller_mode = ENV.fetch('BOT_POLLER_MODE') do
Rails.env.development? if defined?(Rails)
Rails.env.development? if defined?(Rails.env)
end
end
@@ -47,7 +47,7 @@ module Telegram
# Can be overwritten with .bots_config=
def bots_config
@bots_config ||=
if defined?(Rails)
if defined?(Rails.application)
telegram_config = Rails.application.secrets[:telegram] || {}
(telegram_config['bots'] || {}).symbolize_keys.tap do |config|
default = telegram_config['bot']