module Devise::Generators::OrmHelpers

def migration_exists?(table_name)

def migration_exists?(table_name)
  Dir.glob("#{File.join(destination_root, migration_path)}/[0-9]*_*.rb").grep(/\d+_add_devise_to_#{table_name}.rb$/).first
end

def migration_path

def migration_path
  if Rails.version >= '5.0.3'
    db_migrate_path
  else
    @migration_path ||= File.join("db", "migrate")
  end
end

def model_contents

def model_contents
  buffer = <<-CONTENT
clude default devise modules. Others available are:
onfirmable, :lockable, :timeoutable, :trackable and :omniauthable
se :database_authenticatable, :registerable,
   :recoverable, :rememberable, :validatable
T
  buffer
end

def model_exists?

def model_exists?
  File.exist?(File.join(destination_root, model_path))
end

def model_path

def model_path
  @model_path ||= File.join("app", "models", "#{file_path}.rb")
end