Module: ActiveRecord::ActsAs::ClassMethods

Defined in:
lib/active_record/acts_as/class_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(module_) ⇒ Object



10
11
12
# File 'lib/active_record/acts_as/class_methods.rb', line 10

def self.included(module_)
  module_.prepend ReflectionsWithActsAs
end

Instance Method Details

#actablesObject



18
19
20
# File 'lib/active_record/acts_as/class_methods.rb', line 18

def actables
  acting_as_model.where(actable_id: select(:id), actable_type: model_name.name)
end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/active_record/acts_as/class_methods.rb', line 22

def respond_to_missing?(method, include_private = false)
  acting_as_model.methods_callable_by_submodel.include?(method) || super
end

#validators_on(*args) ⇒ Object



14
15
16
# File 'lib/active_record/acts_as/class_methods.rb', line 14

def validators_on(*args)
  super + acting_as_model.validators_on(*args)
end