Sha256: 95418ce0dbca1a9eaad4ca1867d4e13a34b9c209ee1ef08bf60acefcb89e0dc1
Contents?: true
Size: 1.11 KB
Versions: 17
Compression:
Stored size: 1.11 KB
Contents
module Elastics module ActiveModel attr_reader :_version, :_id, :highlight alias_method :id, :_id def self.included(base) base.class_eval do @elastics ||= ClassProxy::Base.new(base) @elastics.extend(ClassProxy::ModelSyncer) @elastics.extend(ClassProxy::ModelIndexer).init @elastics.extend(ClassProxy::ActiveModel).init :params => {:version => true} def self.elastics; @elastics end elastics.synced = [self] include Scopes include ActiveAttr::Model extend ::ActiveModel::Callbacks define_model_callbacks :create, :update, :save, :destroy include Storage::InstanceMethods extend Storage::ClassMethods include Inspection extend Timestamps extend Attachment end end def elastics @elastics ||= InstanceProxy::ActiveModel.new(self) end def elastics_source attributes end def elastics_indexable? true end def method_missing(meth, *args, &block) raw_document.respond_to?(meth) ? raw_document.send(meth) : super end end end
Version data entries
17 entries across 17 versions & 1 rubygems