Updated

db/migrate / 20190401040652_create_trending_domains.rb

A
14 lines of codes
1 methods
9.4 complexity/method
1 churn
9.4 complexity
0 duplications
class CreateTrendingDomains < ActiveRecord::Migration
  1. CreateTrendingDomains has no descriptive comment
def change
  1. CreateTrendingDomains#change has approx 8 statements
create_table :trending_domains do |t|
  1. CreateTrendingDomains#change has the variable name 't'
t.belongs_to :petition, index: true, foreign_key: true
  1. CreateTrendingDomains#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.string :domain, limit: 100, null: false
  1. CreateTrendingDomains#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.integer :count, null: false
  1. CreateTrendingDomains#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.datetime :starts_at, null: false
  1. CreateTrendingDomains#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.timestamps null: false
  1. CreateTrendingDomains#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
end add_index :trending_domains, [:created_at, :count], order: { starts_at: :desc, count: :desc } add_index :trending_domains, [:domain, :petition_id] end end