Class: Bookmark

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/bookmark.rb

Instance Method Summary collapse

Instance Method Details

#default_document_typeObject



19
20
21
# File 'app/models/bookmark.rb', line 19

def default_document_type
  SolrDocument
end

#documentObject



9
10
11
# File 'app/models/bookmark.rb', line 9

def document
  document_type.new document_type.unique_key => document_id
end

#document_typeObject



13
14
15
16
17
# File 'app/models/bookmark.rb', line 13

def document_type
  value = super if defined?(super)
  value &&= value.constantize
  value || default_document_type
end