clarat-org / clarat

An Open Source Charity Directory
http://www.clarat.org/
MIT License
8 stars 10 forks source link

SpitBase & Division über pg_search nützlich durchsuchbar machen #1394

Closed Twiek closed 6 years ago

Twiek commented 6 years ago

Wenn ich in einer SplitBase eine Division hinzufügen will, dann will ich direkt dort ALLE Divisions nach den folgenden Informationen durchsuchen können:

NilsVollmer commented 6 years ago

Deploy TODO task:

Division.find_each do |div|
    next if div.label
    label = "#{div.organization&.name} (#{div.section.identifier})"
    label += ", City: #{div.city.name}" if div.city
    label += ", Area: #{div.area.name}" if div.area
    label += ", Addition: #{div.addition}" if div.addition.present?
    div.update_columns label: label
end

SplitBase.find_each do |sb|
    next if sb.label
    label = "#{sb.title} (id: #{sb.id}"
    label += ", D: #{sb.divisions.map(&:label)}" if sb.divisions.any?
    label += ", SC: #{sb.solution_category.name})" if sb.solution_category
    sb.update_columns label: label
end
NilsVollmer commented 6 years ago

Update: ist aufgespielt & deploy-Todo Task ist durchgelaufen.