Class: ActiveFedora::Aggregation::ListSource
- Inherits:
-
Base
- Object
- Base
- ActiveFedora::Aggregation::ListSource
- Defined in:
- lib/active_fedora/aggregation/list_source.rb
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#clear_changed_attributes ⇒ Object
Overriding so that we don’t track previously_changed, which was rather expensive.
-
#create_date ⇒ Object
Not useful and slows down indexing.
-
#has_model ⇒ Object
Not useful, slows down indexing.
-
#modified_date ⇒ Object
Not useful, slows down indexing.
-
#ordered_self ⇒ Array<ListNode>
Ordered list representation of proxies in graph.
-
#ordered_self=(new_ordered_self) ⇒ Object
Allow this to be set so that -=, += will work.
- #save(*args) ⇒ Object
-
#serializable_hash(options = nil) ⇒ Object
Serializing head/tail/nodes slows things down CONSIDERABLY, and is not useful.
- #to_solr(solr_doc = {}) ⇒ Object
Instance Method Details
#changed? ⇒ Boolean
21 22 23 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 21 def changed? super || ordered_self.changed? end |
#clear_changed_attributes ⇒ Object
Overriding so that we don’t track previously_changed, which was rather expensive.
17 18 19 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 17 def clear_changed_attributes @changed_attributes.clear end |
#create_date ⇒ Object
Not useful and slows down indexing.
54 55 56 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 54 def create_date nil end |
#has_model ⇒ Object
Not useful, slows down indexing.
64 65 66 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 64 def has_model ["ActiveFedora::Aggregation::ListSource"] end |
#modified_date ⇒ Object
Not useful, slows down indexing.
59 60 61 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 59 def modified_date nil end |
#ordered_self ⇒ Array<ListNode>
Ordered list representation of proxies in graph.
27 28 29 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 27 def ordered_self @ordered_self ||= ordered_list_factory.new(resource, head_subject, tail_subject) end |
#ordered_self=(new_ordered_self) ⇒ Object
Allow this to be set so that -=, += will work.
34 35 36 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 34 def ordered_self=(new_ordered_self) @ordered_self = new_ordered_self end |
#save(*args) ⇒ Object
9 10 11 12 13 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 9 def save(*args) return true if has_unpersisted_proxy_for? || !changed? persist_ordered_self if ordered_self.changed? super end |
#serializable_hash(options = nil) ⇒ Object
This method is used by ActiveFedora::Base upstream for indexing, at github.com/projecthydra/active_fedora/blob/master/lib/active_fedora/profile_indexing_service.rb.
Serializing head/tail/nodes slows things down CONSIDERABLY, and is not useful.
42 43 44 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 42 def serializable_hash(=nil) {} end |
#to_solr(solr_doc = {}) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 46 def to_solr(solr_doc={}) super.merge({ ordered_targets_ssim: ordered_self.target_ids, proxy_in_ssi: ordered_self.proxy_in.to_s }) end |