Class: Strongbolt::Generators::FixGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Migration
Defined in:
lib/generators/strongbolt/fix_generator.rb

Overview

Creates a migration to fix a has many through with users tenants problem

Instance Method Summary collapse

Methods included from Migration

included

Instance Method Details

#copy_fixObject



13
14
15
16
17
18
19
# File 'lib/generators/strongbolt/fix_generator.rb', line 13

def copy_fix
  if Strongbolt::UsersTenant.primary_key.nil?
    copy_migration 'fix', 'fix_strongbolt_users_tenants_id'
  else
    puts 'Strongbolt::UsersTenant already has a primary key, no need to use the fix'
  end
end