Updated

db/migrate / 20190502104930_create_default_domains.rb

A
16 lines of codes
2 methods
2.2 complexity/method
1 churn
4.35 complexity
0 duplications
class CreateDefaultDomains < ActiveRecord::Migration
  1. CreateDefaultDomains has no descriptive comment
class Domain < ActiveRecord::Base
  1. CreateDefaultDomains::Domain has no descriptive comment
has_many :aliases, -> { create_with(strip_extension: nil, strip_characters: nil) }, foreign_key: "canonical_domain_id", class_name: "Domain" end def up
  1. CreateDefaultDomains#up doesn't depend on instance state (maybe move it to another class?)
gmail = Domain.create!(name: "gmail.com", strip_extension: "+", strip_characters: ".") gmail.aliases.create!(name: "googlemail.com") end def down
  1. CreateDefaultDomains#down doesn't depend on instance state (maybe move it to another class?)
Domain.delete_all end end