Updated

db/migrate / 20170627125046_add_new_conservative_government.rb

A
18 lines of codes
2 methods
2.8 complexity/method
1 churn
5.55 complexity
0 duplications
class AddNewConservativeGovernment < ActiveRecord::Migration
  1. AddNewConservativeGovernment has no descriptive comment
class Parliament < ActiveRecord::Base; end
  1. AddNewConservativeGovernment::Parliament has no descriptive comment
def up
  1. AddNewConservativeGovernment#up doesn't depend on instance state (maybe move it to another class?)
Parliament.create!( government: "Conservative", opening_at: "2017-07-10T12:00:00".in_time_zone, dissolution_faq_url: "https://www.parliament.uk/business/committees/committees-a-z/commons-select/petitions-committee/news-parliament-2015/petitions-2017-election--faqs/", dissolved_heading: "We're waiting for a new Petitions Committee", dissolved_message: "Petitions had to stop because of the recent general election. As soon as a new Petitions Committee is set up by the House of Commons, petitions will start again." ) end def down
  1. AddNewConservativeGovernment#down doesn't depend on instance state (maybe move it to another class?)
parliament = Parliament.find_by!(opening_at: "2017-07-10T12:00:00".in_time_zone) parliament.destroy end end