Class: E621ExportDownloader::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- E621ExportDownloader::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/e621_export_downloader/install_generator.rb
Overview
Rails generator used for setting up E621ExportDownloader tables in a Rails application. Run it with bin/rails g e621_export_downloader:install in your console.
Constant Summary collapse
- TEMPLATES =
File.join(File.dirname(__FILE__), "templates")
Instance Method Summary collapse
Instance Method Details
#create_initializer ⇒ Object
31 32 33 |
# File 'lib/generators/e621_export_downloader/install_generator.rb', line 31 def create_initializer template("initializers/e621_models.rb.erb", "config/initializers/e621_models.rb") end |
#create_migration_file ⇒ Object
27 28 29 |
# File 'lib/generators/e621_export_downloader/install_generator.rb', line 27 def create_migration_file migration_template("migrations/create_e621_tables.rb.erb", File.join(db_migrate_path, "create_e621_tables.rb")) end |
#validate_options ⇒ Object
22 23 24 25 |
# File 'lib/generators/e621_export_downloader/install_generator.rb', line 22 def return if %w[schema prefix].include?([:table_format]) abort("--table-format must be 'schema' or 'prefix', got '#{[:table_format]}'") end |