Class: IbanBic::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- IbanBic::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/iban_bic/install_generator.rb
Overview
Installs Iban+Bic in a rails app.
Class Method Summary collapse
Instance Method Summary collapse
- #bics_table_name ⇒ Object
- #create_initializer ⇒ Object
- #create_migration_file ⇒ Object
- #migration_version ⇒ Object
- #static_bics? ⇒ Boolean
Class Method Details
.next_migration_number(dirname) ⇒ Object
38 39 40 |
# File 'lib/generators/iban_bic/install_generator.rb', line 38 def self.next_migration_number(dirname) ::ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#bics_table_name ⇒ Object
46 47 48 |
# File 'lib/generators/iban_bic/install_generator.rb', line 46 def bics_table_name .bics_table_name end |
#create_initializer ⇒ Object
34 35 36 |
# File 'lib/generators/iban_bic/install_generator.rb', line 34 def create_initializer template "iban_bic.rb.erb", File.join("config", "initializers", "iban_bic.rb") end |
#create_migration_file ⇒ Object
30 31 32 |
# File 'lib/generators/iban_bic/install_generator.rb', line 30 def create_migration_file migration_template "create_bics.rb.erb", File.join("db", "migrate", "create_bics.rb") unless .with_static_bics? end |
#migration_version ⇒ Object
42 43 44 |
# File 'lib/generators/iban_bic/install_generator.rb', line 42 def migration_version "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]" end |
#static_bics? ⇒ Boolean
50 51 52 |
# File 'lib/generators/iban_bic/install_generator.rb', line 50 def static_bics? .with_static_bics? end |