chore: reorganize para current/, rails 8.1, testes e readme

- move app para current/ (estrutura capistrano)
- rails 7.2 → 8.1, ruby 3.2, sqlite3 2.x
- adiciona primary_key Idinformativo no model
- schema.rb completo com todas as tabelas
- testes minitest: models (Tag, Informativo, Tema) e controllers
- readme atualizado em pt-br com stack e instruções de desenvolvimento
- gitignore exclui dump.sql, *.duckdb e sqlite3
This commit is contained in:
2026-06-18 18:58:01 +02:00
parent 691ed8e7e5
commit 25832564f9
132 changed files with 2067 additions and 1253 deletions

View File

@@ -0,0 +1,28 @@
namespace :import do
desc "generate markdown from html"
task :as_markdown => :environment do
Informativo.all.each do |i|
i.update(markdown: i.as_markdown)
end
end
desc "fix tags"
task :tags => :environment do
Informativo.all.each do |i|
tags = []
tags << i.tag1.split(", ") if i.tag1
tags << i.tag2.split(", ") if i.tag2
tags << i.tag3.split(", ") if i.tag3
tags.flatten.compact.each do |t|
i.tags << Tag.find_or_create_by(nome: t.gsub(",", "")) unless t.empty?
end
i.tags = i.tags.uniq
i.save
end
Tag.all.each do |t|
t.update(count: t.informativos.count)
end
end
end