Class: Rails::Snowflake::Generators::InstallGenerator

Inherits:
Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/rails/snowflake/generators/install/install_generator.rb

Constant Summary collapse

TEMPLATES =
File.join(File.dirname(__FILE__), "templates")

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.namespace(name = nil) ⇒ Object

Ensure the Thor/Rails namespace is rails_snowflake:install



13
14
15
16
17
18
19
# File 'lib/rails/snowflake/generators/install/install_generator.rb', line 13

def self.namespace(name = nil)
  if name
    super
  else
    @namespace ||= "rails_snowflake:install"
  end
end

Instance Method Details

#create_migration_fileObject



26
27
28
# File 'lib/rails/snowflake/generators/install/install_generator.rb', line 26

def create_migration_file
  migration_template "install_snowflake_id.rb.erb", File.join(db_migrate_path, "install_snowflake_id.rb")
end