app/services/clean.rb
# Returns a (unsaved) metadata which only covers the current
# scope and which can be modified/deleted safely, without
# changing a metadata out of the scope
Returns a (unsaved) metadata which only covers the current
scope and which can be modified/deleted safely, without
changing a metadata out of the scope
Returns a ( unsaved ) metadata which only covers the current scope and which can be modified / deleted safely without changing a metadata out of the scope
def restricted_metadata(metadata)
        return metadata if metadata.line_ids == [ line_id ]
        restricted = metadata.dup
        restricted.id = nil
        restricted.line_ids = [line_id]
        metadata.line_ids.delete line_id
        metadata.save!
        restricted
      end
def restricted_metadata ( metadata ) return metadata if metadata . line_ids == [ line_id ] restricted = metadata . dup restricted . id = nil restricted . line_ids = [ line_id ] metadata . line_ids . delete line_id metadata . save! restricted end
Returns a (unsaved) metadata which only covers the current
scope and which can be modified/deleted safely, without
changing a metadata out of the scope
Returns a ( unsaved ) metadata which only covers the current scope and which can be modified / deleted safely without changing a metadata out of the scope
# return nil unless metadata.line_ids.include? line_id
metadata