Updated

db/migrate / 20190330185021_create_trending_ips.rb

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