Sha256: c589fd40e885823b0f8a43c7cd39ff3864f0da8703ee62332bdb849bb1e170ec
Contents?: true
Size: 1.5 KB
Versions: 22
Compression:
Stored size: 1.5 KB
Contents
module Ransack module Adapters def self.object_mapper @object_mapper ||= instantiate_object_mapper end def self.instantiate_object_mapper if defined?(::ActiveRecord::Base) ActiveRecordAdapter.new elsif defined?(::Mongoid) MongoidAdapter.new else raise "Unsupported adapter" end end class ActiveRecordAdapter def require_constants require 'ransack/adapters/active_record/ransack/constants' end def require_adapter require 'ransack/adapters/active_record/ransack/translate' require 'ransack/adapters/active_record' end def require_context require 'ransack/adapters/active_record/ransack/visitor' end def require_nodes require 'ransack/adapters/active_record/ransack/nodes/condition' end def require_search require 'ransack/adapters/active_record/ransack/context' end end class MongoidAdapter def require_constants require 'ransack/adapters/mongoid/ransack/constants' end def require_adapter require 'ransack/adapters/mongoid/ransack/translate' require 'ransack/adapters/mongoid' end def require_context require 'ransack/adapters/mongoid/ransack/visitor' end def require_nodes require 'ransack/adapters/mongoid/ransack/nodes/condition' end def require_search require 'ransack/adapters/mongoid/ransack/context' end end end end
Version data entries
22 entries across 22 versions & 2 rubygems