Data

From AwesomeWiki
Revision as of 06:16, 14 October 2024 by Jcn (talk | contribs) (Created page with "Snippets of code, etc for pulling data from the database. == All projects with chapter info and funding details (used for the Summit data analysis) == rails runner "Projec...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Snippets of code, etc for pulling data from the database.

All projects with chapter info and funding details (used for the Summit data analysis)

rails runner  "Project.joins(:chapter).pluck(:id, Arel.sql('TO_CHAR(created_at, \'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"\')'), 'chapters.name', Arel.sql('CASE WHEN chapters.inactive_at IS NULL THEN \'Active\' ELSE \'Inactive\' END'), Arel.sql('TO_CHAR(funded_on, \'YYYY-MM-DD\')'), Arel.sql('TO_CHAR(funded_on, \'YYYY-MM\')')).each { |p| puts p.join(%Q(\t)) }"