Updated

db/migrate / 20170612120307_add_petition_duration_to_parliament.rb

A
14 lines of codes
2 methods
3.0 complexity/method
2 churn
5.9 complexity
0 duplications
class AddPetitionDurationToParliament < ActiveRecord::Migration
  1. AddPetitionDurationToParliament has no descriptive comment
class Parliament < ActiveRecord::Base; end
  1. AddPetitionDurationToParliament::Parliament has no descriptive comment
def up add_column :parliaments, :petition_duration, :integer, null: false, default: 6 parliament = Parliament.find_by!(opening_at: "2010-05-18T00:00:00".in_time_zone) parliament.update(petition_duration: 12) end def down remove_column :parliaments, :petition_duration end end