Class: Switchman::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/switchman/engine.rb

Class Method Summary collapse

Class Method Details

.foreign_key_check(name, type, options) ⇒ Object



100
101
102
103
104
# File 'lib/switchman/engine.rb', line 100

def self.foreign_key_check(name, type, options)
  if name.to_s =~ /_id\z/ && type.to_s == 'integer' && options[:limit].to_i < 8
    puts "WARNING: All foreign keys need to be 8-byte integers. #{name} looks like a foreign key. If so, please add the option: `:limit => 8`"
  end
end