Sha256: 611b7168849c3af7369461e6abd9632572dfc4331d8cd514e7715c37b6f0aa58

Contents?: true

Size: 619 Bytes

Versions: 57

Compression:

Stored size: 619 Bytes

Contents

module Spotlight
  module SolrDocument
    ##
    # ActiveModel stubs to make {::SolrDocument}s work as activemodel objects
    module ActiveModelConcern
      extend ActiveSupport::Concern

      included do
        include Spotlight::ArLight
        extend ActiveModel::Callbacks
        define_model_callbacks :save
      end

      def save
        run_callbacks :save do
          # no-op
        end
      end

      def to_key
        [id]
      end

      def persisted?
        true
      end

      def destroyed?
        false
      end

      def new_record?
        !persisted?
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
blacklight-spotlight-0.34.1 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.34.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.33.3 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.33.2 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.33.1 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.33.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.32.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.31.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.30.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.29.1 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.29.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.28.3 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.28.2 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.28.1 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.28.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.27.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.26.1 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.26.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.25.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb
blacklight-spotlight-0.24.0 app/models/concerns/spotlight/solr_document/active_model_concern.rb