Class: ActiveRecord::Generators::DeviseInvitableGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/active_record/devise_invitable_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_devise_migrationObject


8
9
10
# File 'lib/generators/active_record/devise_invitable_generator.rb', line 8

def copy_devise_migration
  migration_template 'migration.rb', "db/migrate/devise_invitable_add_to_#{table_name}.rb", migration_version: migration_version
end

#migration_versionObject


12
13
14
15
16
# File 'lib/generators/active_record/devise_invitable_generator.rb', line 12

def migration_version
  if Rails::VERSION::MAJOR >= 5
    "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
  end
end