Class: Collection
Instance Attribute Summary collapse
Instance Method Summary
collapse
#add_member, #add_relationship, #remove_member, #to_s
#human_readable_type
#exists?
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
12
13
14
|
# File 'app/repository_models/collection.rb', line 12
def file
@file
end
|
#mime_type ⇒ Object
Returns the value of attribute mime_type.
11
12
13
|
# File 'app/repository_models/collection.rb', line 11
def mime_type
@mime_type
end
|
Instance Method Details
#add_profile_image ⇒ Object
22
23
24
25
26
27
28
|
# File 'app/repository_models/collection.rb', line 22
def add_profile_image
if file
self.content.content = file
self.mime_type = file.content_type
generate_derivatives
end
end
|
#can_be_member_of_collection?(collection) ⇒ Boolean
18
19
20
|
# File 'app/repository_models/collection.rb', line 18
def can_be_member_of_collection?(collection)
collection == self ? false : true
end
|
#representative ⇒ Object
42
43
44
|
# File 'app/repository_models/collection.rb', line 42
def representative
to_param
end
|
#representative_image_url ⇒ Object
30
31
32
|
# File 'app/repository_models/collection.rb', line 30
def representative_image_url
generate_thumbnail_url if self.thumbnail.content.present?
end
|
#to_solr(solr_doc = {}, opts = {}) ⇒ Object
34
35
36
37
38
39
40
|
# File 'app/repository_models/collection.rb', line 34
def to_solr(solr_doc={}, opts={})
super(solr_doc, opts)
Solrizer.set_field(solr_doc, 'generic_type', 'Collection', :facetable)
solr_doc[Solrizer.solr_name('representative', :stored_searchable)] = self.representative
solr_doc[Solrizer.solr_name('representative_image_url', :stored_searchable)] = self.representative_image_url
solr_doc
end
|