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
20 21 22 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 20 def changed? super || ordered_self.changed? end |
#clear_changed_attributes ⇒ Object
Overriding so that we don’t track previously_changed, which was rather expensive.
16 17 18 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 16 def clear_changed_attributes @changed_attributes.clear end |
#create_date ⇒ Object
Not useful and slows down indexing.
53 54 55 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 53 def create_date nil end |
#has_model ⇒ Object
Not useful, slows down indexing.
63 64 65 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 63 def has_model ["ActiveFedora::Aggregation::ListSource"] end |
#modified_date ⇒ Object
Not useful, slows down indexing.
58 59 60 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 58 def modified_date nil end |
#ordered_self ⇒ Array<ListNode>
Ordered list representation of proxies in graph.
26 27 28 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 26 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.
33 34 35 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 33 def ordered_self=(new_ordered_self) @ordered_self = new_ordered_self end |
#save(*args) ⇒ Object
8 9 10 11 12 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 8 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.
41 42 43 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 41 def serializable_hash(=nil) {} end |
#to_solr(solr_doc = {}) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/active_fedora/aggregation/list_source.rb', line 45 def to_solr(solr_doc={}) super.merge({ ordered_targets_ssim: ordered_self.target_ids, proxy_in_ssi: ordered_self.proxy_in.to_s }) end |