Class: Chewy::Index::Adapter::ActiveRecord

Inherits:
Orm
  • Object
show all
Defined in:
lib/chewy/index/adapter/active_record.rb

Constant Summary

Constants inherited from Base

Base::BATCH_SIZE

Instance Attribute Summary

Attributes inherited from Orm

#default_scope

Attributes inherited from Base

#options, #target

Class Method Summary collapse

Methods inherited from Orm

#identify, #import, #import_fields, #initialize, #load, #name

Methods inherited from Base

#identify, #import, #import_fields, #import_references, #load, #name, #type_name

Constructor Details

This class inherits a constructor from Chewy::Index::Adapter::Orm

Class Method Details

.accepts?(target) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/chewy/index/adapter/active_record.rb', line 7

def self.accepts?(target)
  defined?(::ActiveRecord::Base) && (
    (target.is_a?(Class) && target < ::ActiveRecord::Base) ||
    target.is_a?(::ActiveRecord::Relation))
end