Class: Msgr::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/msgr/railtie.rb

Class Method Summary collapse

Class Method Details

.load(config) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/msgr/railtie.rb', line 23

def load(config)
  # Set defaults
  config.reverse_merge!(
    checkcredentials: true,
    routing_file: Rails.root.join('config/msgr.rb').to_s,
  )

  Msgr.config = config
  Msgr.client.connect if config.fetch(:checkcredentials)
end