Updated

db/migrate / 20170419165419_create_parliaments.rb

A
26 lines of codes
2 methods
5.8 complexity/method
1 churn
11.65 complexity
16 duplications
class CreateParliaments < ActiveRecord::Migration
  1. CreateParliaments has no descriptive comment
class Parliament < ActiveRecord::Base; end
  1. CreateParliaments::Parliament has no descriptive comment
def up create_table :parliaments do |t|
  1. Similar code found in 2 nodes Locations: 0 1
  2. CreateParliaments#up has the variable name 't'
t.datetime :dissolution_at
  1. CreateParliaments#up refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2
t.text :dissolution_message
  1. CreateParliaments#up refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2
t.timestamps null: false
  1. CreateParliaments#up refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2
end Parliament.create!( dissolution_at: Date.civil(2017, 5, 3).end_of_day, dissolution_message: <<-EOF.squish The House of Commons has voted in favour of holding an early General Election, on Thursday 8 June. This means that Parliament will be dissolved at midnight on Wednesday 3 May, and that all parliamentary business – including petitions – will stop until the new Parliament meets. EOF ) end def down drop_table :parliaments end end