Sha256: de98a847c7f0fa4433acde754667a32418c0e093d16bc538802162e4d6a86f81

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

module PluckAll
  class Hooks
    class << self
      def init
        require 'pluck_all/models/active_record_extension' if require_if_exists('active_record')
        require 'pluck_all/models/mongoid_extension' if require_if_exists('mongoid')
      end

      private

      def require_if_exists(path)
        require path
        return true
      rescue LoadError, Gem::LoadError
        return false
      end
    end
  end
end

PluckAll::Hooks.init

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pluck_all-2.3.0 lib/pluck_all/hooks.rb
pluck_all-2.2.1 lib/pluck_all/hooks.rb
pluck_all-2.1.0 lib/pluck_all/hooks.rb