require "action_store/version"
require "action_store/configuration"
require "action_store/engine"
require "action_store/model"
require "action_store/mixin"

module ActionStore
  class << self
    def config
      return @config if defined?(@config)
      @config = Configuration.new
      @config
    end

    def configure(&block)
      config.instance_exec(&block)
    end
  end
end

ActiveRecord::Base.send(:include, ActionStore::Mixin)
require "action_store/version"
require "action_store/configuration"
require "action_store/engine"
require "action_store/model"
require "action_store/mixin"

module ActionStore
  class << self
    def config
      return @config if defined?(@config)
      @config = Configuration.new
      @config
    end

    def configure(&block)
      config.instance_exec(&block)
    end
  end
end

ActiveSupport.on_load(:active_record) do
  include ActionStore::Mixin
end

Use `ActiveSupport.on_load` to hook into Active Record.
Use `ActiveSupport.on_load` to hook into Active Record.

https://github.com/rails/rails/issues/23589#issuecomment-229247727
https://github.com/plataformatec/devise/commit/c2c74b0
