Sha256: 124a15b6efbfc2f1b0cfa8bc711cb9ba0f3d01d6a9de287df06fbb48a2066ecc

Contents?: true

Size: 480 Bytes

Versions: 2

Compression:

Stored size: 480 Bytes

Contents

module ActiveRecord
  module ActsAs
    module ReflectionsWithActsAs
      def _reflections
        super.reverse_merge(acting_as_model._reflections)
      end
    end

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

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

      def actables
        acting_as_model.where(actable_id: select(:id))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_record-acts_as-2.1.1 lib/active_record/acts_as/class_methods.rb
active_record-acts_as-2.1.0 lib/active_record/acts_as/class_methods.rb