module ActiveRecord::ActsAs::ClassMethods
Public Class Methods
included(module_)
click to toggle source
# File lib/active_record/acts_as/class_methods.rb, line 10 def self.included(module_) module_.prepend ReflectionsWithActsAs end
Public Instance Methods
actables()
click to toggle source
# File lib/active_record/acts_as/class_methods.rb, line 18 def actables acting_as_model.where(actable_id: select(:id)) end
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/active_record/acts_as/class_methods.rb, line 26 def method_missing(method, *args, &block) if acting_as_model.methods_callable_by_submodel.include?(method) result = acting_as_model.public_send(method, *args, &block) if result.is_a?(ActiveRecord::Relation) all.joins(acting_as_name.to_sym).merge(result) else result end else super end end
respond_to_missing?(method, include_private = false)
click to toggle source
Calls superclass method
# 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)
click to toggle source
Calls superclass method
# File lib/active_record/acts_as/class_methods.rb, line 14 def validators_on(*args) super + acting_as_model.validators_on(*args) end