Class: AddMinutesToPunches
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- AddMinutesToPunches
- Defined in:
- lib/db/migrate/03_add_minutes_to_punches.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
9 10 11 |
# File 'lib/db/migrate/03_add_minutes_to_punches.rb', line 9 def self.down remove_column :punches, :minutes, :integer end |
.up ⇒ Object
2 3 4 5 6 7 |
# File 'lib/db/migrate/03_add_minutes_to_punches.rb', line 2 def self.up add_column :punches, :minutes, :integer, :default => 0 Punch.all.each do |p| p.save! end end |