diff --git a/lib/active_fedora/aggregation/list_source.rb b/lib/active_fedora/aggregation/list_source.rb index 65c0fea81..a42207b06 100644 --- a/lib/active_fedora/aggregation/list_source.rb +++ b/lib/active_fedora/aggregation/list_source.rb @@ -80,6 +80,7 @@ def persist_ordered_self # Set node subjects to a term in AF JUST so that AF will persist the # sub-graphs. # TODO: Find a way to fix this. + # See https://github.com/samvera/active_fedora/issues/1337 resource.set_value(:nodes, []) self.nodes += graph.subjects.to_a ordered_self.changes_committed! diff --git a/lib/active_fedora/associations/builder/collection_association.rb b/lib/active_fedora/associations/builder/collection_association.rb index 9a2870dd0..18cae50a2 100644 --- a/lib/active_fedora/associations/builder/collection_association.rb +++ b/lib/active_fedora/associations/builder/collection_association.rb @@ -26,6 +26,7 @@ def self.define_callback(model, callback_name, name, options) full_callback_name = "#{callback_name}_for_#{name}" # TODO : why do i need method_defined? I think its because of the inheritance chain + # See https://github.com/samvera/active_fedora/issues/1333 model.class_attribute full_callback_name.to_sym unless model.method_defined?(full_callback_name) callbacks = Array(options[callback_name.to_sym]).map do |callback| diff --git a/lib/active_fedora/associations/collection_association.rb b/lib/active_fedora/associations/collection_association.rb index d96fde324..beff9a174 100644 --- a/lib/active_fedora/associations/collection_association.rb +++ b/lib/active_fedora/associations/collection_association.rb @@ -43,6 +43,7 @@ def ids_writer(ids) ids = Array(ids).reject(&:blank?) replace(klass.find(ids)) # .index_by { |r| r.id }.values_at(*ids)) # TODO, like this when find() can return multiple records + # See https://github.com/samvera/active_fedora/issues/1340 # send("#{reflection.name}=", reflection.klass.find(ids)) # send("#{reflection.name}=", ids.collect { |id| reflection.klass.find(id)}) end @@ -171,6 +172,7 @@ def concat_records(*records) # See delete for more info. def delete_all # TODO: load_target causes extra loads. Can't we just send delete requests? + # See https://github.com/samvera/active_fedora/issues/1341 delete(load_target).tap do reset loaded! @@ -301,6 +303,7 @@ def construct_query def find_target # TODO: don't reify, just store the solr results and lazily reify. # For now, we set a hard limit of 1000 results. + # See https://github.com/samvera/active_fedora/issues/1358 records = ActiveFedora::QueryResultBuilder.reify_solr_results(load_from_solr(rows: SolrService::MAX_ROWS)) records.each { |record| set_inverse_instance(record) } records diff --git a/lib/active_fedora/associations/directly_contains_one_association.rb b/lib/active_fedora/associations/directly_contains_one_association.rb index ca494a543..b87575528 100644 --- a/lib/active_fedora/associations/directly_contains_one_association.rb +++ b/lib/active_fedora/associations/directly_contains_one_association.rb @@ -4,6 +4,7 @@ module Associations class DirectlyContainsOneAssociation < SingularAssociation #:nodoc: # Finds objects contained by the container predicate (either the configured has_member_relation or ldp:contains) # TODO: Refactor this to use solr (for efficiency) instead of parsing the RDF graph. Requires indexing ActiveFedora::File objects into solr, including their RDF.type and, if possible, the id of their container + # See https://github.com/samvera/active_fedora/issues/1335 def find_target # filtered_objects = container_association_proxy.to_a.select { |o| o.metadata_node.type.include?(options[:type]) } query_node = if container_predicate = options[:has_member_relation] diff --git a/lib/active_fedora/associations/indirectly_contains_association.rb b/lib/active_fedora/associations/indirectly_contains_association.rb index 7f2d0fa37..9dec02747 100644 --- a/lib/active_fedora/associations/indirectly_contains_association.rb +++ b/lib/active_fedora/associations/indirectly_contains_association.rb @@ -2,6 +2,7 @@ module ActiveFedora module Associations # TODO: we may want to split this into two subclasses, one for has_member_relation # and the other for is_member_of_relation + # See https://github.com/samvera/active_fedora/issues/1332 class IndirectlyContainsAssociation < ContainsAssociation #:nodoc: # Add +records+ to this association. Returns +self+ so method calls may be chained. # Since << flattens its argument list and inserts each record, +push+ and +concat+ behave identically. @@ -40,6 +41,7 @@ def find_target uris.map { |object_uri| klass.find(klass.uri_to_id(object_uri)) } else # is_member_of_relation # TODO this is a lot of reads. Avoid this path + # See https://github.com/samvera/active_fedora/issues/1345 container_predicate = ::RDF::Vocab::LDP.contains proxy_uris = container.resource.query(predicate: container_predicate).map { |r| r.object.to_s } proxy_uris.map { |uri| proxy_class.find(proxy_class.uri_to_id(uri))[options[:foreign_key]] } diff --git a/lib/active_fedora/associations/singular_association.rb b/lib/active_fedora/associations/singular_association.rb index 9b9c505fb..4e4b84864 100644 --- a/lib/active_fedora/associations/singular_association.rb +++ b/lib/active_fedora/associations/singular_association.rb @@ -33,6 +33,7 @@ def build(attributes = {}) def find_target # TODO: this forces a solr query, but I think it's likely we can just lookup from Fedora. + # See https://github.com/samvera/active_fedora/issues/1330 rec = scope.take rec.tap { |record| set_inverse_instance(record) } end diff --git a/lib/active_fedora/attributes/property_builder.rb b/lib/active_fedora/attributes/property_builder.rb index bad571dbe..30e91d777 100644 --- a/lib/active_fedora/attributes/property_builder.rb +++ b/lib/active_fedora/attributes/property_builder.rb @@ -57,6 +57,7 @@ def #{name}=(value) def build(&block) # TODO: remove this block stuff + # See https://github.com/samvera/active_fedora/issues/1336 NodeConfig.new(name, options[:predicate], options.except(:predicate)) do |config| config.with_index(&block) if block_given? end diff --git a/lib/active_fedora/indexing/field_mapper.rb b/lib/active_fedora/indexing/field_mapper.rb index c76938e91..86b74c850 100644 --- a/lib/active_fedora/indexing/field_mapper.rb +++ b/lib/active_fedora/indexing/field_mapper.rb @@ -22,6 +22,7 @@ def set_field(doc, name, value, *indexer_args) # @api # Given a field name, index_type, etc., returns the corresponding Solr name. # TODO field type is the input format, maybe we could just detect that? + # See https://github.com/samvera/active_fedora/issues/1338 # @param [String] field_name the ruby (term) name which will get a suffix appended to become a Solr field name # @param opts - index_type is only needed if the FieldDescriptor requires it (e.g. :searcahble) # @return [String] name of the solr field, based on the params @@ -69,6 +70,7 @@ def solr_names_and_values(field_name, field_value, index_types) # Is there a custom converter? # TODO instead of a custom converter, look for input data type and output data type. Create a few methods that can do that cast. + # See https://github.com/samvera/active_fedora/issues/1339 value = if converter if converter.arity == 1 diff --git a/lib/active_fedora/indexing/suffix.rb b/lib/active_fedora/indexing/suffix.rb index d63468299..ec3c4d968 100644 --- a/lib/active_fedora/indexing/suffix.rb +++ b/lib/active_fedora/indexing/suffix.rb @@ -45,12 +45,14 @@ def to_s end def self.config + # TODO: `:symbol' usage ought to be deprecated + # See https://github.com/samvera/active_fedora/issues/1334 @config ||= OpenStruct.new fields: [:type, :stored, :indexed, :multivalued], suffix_delimiter: '_', type_suffix: (lambda do |fields| type = fields.first case type - when :string, :symbol # TODO: `:symbol' usage ought to be deprecated + when :string, :symbol 's' when :text 't' diff --git a/lib/active_fedora/loadable_from_json.rb b/lib/active_fedora/loadable_from_json.rb index 1180d2d05..fde4a999b 100644 --- a/lib/active_fedora/loadable_from_json.rb +++ b/lib/active_fedora/loadable_from_json.rb @@ -131,6 +131,7 @@ def init_with_json(json) @resource = SolrBackedResource.new(self.class) self.attributes = adapt_attributes(attrs) # TODO: Should we clear the change tracking, or make this object Read-only? + # See https://github.com/samvera/active_fedora/issues/1342 yield self if block_given? diff --git a/lib/active_fedora/nested_attributes.rb b/lib/active_fedora/nested_attributes.rb index 9f39a8ff5..02b441f10 100644 --- a/lib/active_fedora/nested_attributes.rb +++ b/lib/active_fedora/nested_attributes.rb @@ -64,6 +64,7 @@ def accepts_nested_attributes_for(*attr_names) reflection.autosave = true define_autosave_association_callbacks(reflection) ## TODO this ought to work, but doesn't seem to do the class inheritance right + # See https://github.com/samvera/active_fedora/issues/1343 nested_attributes_options = self.nested_attributes_options.dup nested_attributes_options[association_name.to_sym] = options diff --git a/lib/active_fedora/reflection.rb b/lib/active_fedora/reflection.rb index b084442ca..ad79fe6d2 100644 --- a/lib/active_fedora/reflection.rb +++ b/lib/active_fedora/reflection.rb @@ -314,7 +314,7 @@ def check_validity_of_inverse! def collect_join_chain [self] end - alias chain collect_join_chain # todo + alias chain collect_join_chain # TODO Remove alias, See https://github.com/samvera/active_fedora/issues/1347 def has_inverse? inverse_name diff --git a/lib/active_fedora/relation/finder_methods.rb b/lib/active_fedora/relation/finder_methods.rb index 88a2f73c4..cc9ee3313 100644 --- a/lib/active_fedora/relation/finder_methods.rb +++ b/lib/active_fedora/relation/finder_methods.rb @@ -262,6 +262,7 @@ def condition_to_clauses(key, value, join_with = SolrQueryBuilder.default_join_w def field_name_for(key) if @klass.delegated_attributes.key?(key) # TODO: Check to see if `key' is a possible solr field for this class, if it isn't try :searchable instead + # See https://github.com/samvera/active_fedora/issues/1344 ActiveFedora.index_field_mapper.solr_name(key, :stored_searchable, type: :string) elsif key == :id ActiveFedora.id_field diff --git a/lib/active_fedora/relation/merger.rb b/lib/active_fedora/relation/merger.rb index 1e670aa55..2ac430b35 100644 --- a/lib/active_fedora/relation/merger.rb +++ b/lib/active_fedora/relation/merger.rb @@ -14,6 +14,7 @@ def initialize(relation, other) def merge # TODO: merge order + # See https://github.com/samvera/active_fedora/issues/1329 relation.where_values += other.where_values relation end diff --git a/lib/active_fedora/with_metadata.rb b/lib/active_fedora/with_metadata.rb index bdfb86781..dbeb1abcc 100644 --- a/lib/active_fedora/with_metadata.rb +++ b/lib/active_fedora/with_metadata.rb @@ -20,6 +20,7 @@ def metadata_node def create_or_update(*) return unless super && !new_record? + # TODOs captured as https://github.com/samvera/active_fedora/issues/1331 metadata_node.metadata_uri = described_by # TODO: only necessary if the URI was < > before metadata_node.save # TODO if changed? end diff --git a/lib/generators/active_fedora/config/solr/templates/solr/config/schema.xml b/lib/generators/active_fedora/config/solr/templates/solr/config/schema.xml index 8a7c346dd..301a0fb8f 100644 --- a/lib/generators/active_fedora/config/solr/templates/solr/config/schema.xml +++ b/lib/generators/active_fedora/config/solr/templates/solr/config/schema.xml @@ -57,6 +57,7 @@ 1.4: default auto-phrase (QueryParser feature) to off 1.5: omitNorms defaults to true for primitive field types (int, float, boolean, string...) # TODO 1.6: useDocValuesAsStored defaults to true. +# See https://github.com/samvera/active_fedora/issues/1346 -->