Class: SpreeAuth::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/apispree_auth.rb

Class Method Summary collapse

Class Method Details

.activateObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/apispree_auth.rb', line 11

def self.activate
  Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
    Rails.env.production? ? require(c) : load(c)
  end

  # monkey patch until new version of devise comes out
  # https://github.com/plataformatec/devise/commit/ec5bfe9119d0e1e633629793b0de1f58f89622dc
  Devise::IndifferentHash.class_eval do
    def [](key)
      super(convert_key(key))
    end
    def to_hash; Hash.new.update(self) end
  end
end