Quellcode durchsuchen

Add rake task for listing elections

tags/last-sinatra-version
Adrian Short vor 6 Jahren
Ursprung
Commit
105b83c345
1 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
  1. +11
    -0
      Rakefile

+ 11
- 0
Rakefile Datei anzeigen

@@ -1,5 +1,16 @@
require './models'

task default: :elections

desc "List elections"
task :elections do
puts "%3s %-10s %-20s %6s" % %w( ID Date Body Candidacies)
#puts "ID Date Body Candidacies"
Election.each do |e|
puts "%3d %s %-20s %6d" % [ e.id, e.d, e.body.name, e.candidacies.size ]
end
end

desc "Set the candidate positions for an election (will prompt you for election ID)."
task :set_positions do
Election.all.each do |e|


Laden…
Abbrechen
Speichern