Class: Roomer::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Roomer::Generators::InstallGenerator
- Defined in:
- lib/generators/roomer/install/install_generator.rb
Instance Method Summary collapse
-
#copy_initializer ⇒ Object
Generates the Initializer under config/initializers/roomer.rb.
-
#shared_schema_name ⇒ Symbol
Reads the shared-schema-name and assigns it to Roomer.shared_schema_name.
-
#show_readme ⇒ Object
Displays the instructions for setting up Roomer.
-
#tenants_table ⇒ Symbol
Reads the tenants-table option and assigns it to Roomer.tenants_table config parameter.
Instance Method Details
#copy_initializer ⇒ Object
Generates the Initializer under config/initializers/roomer.rb
28 29 30 |
# File 'lib/generators/roomer/install/install_generator.rb', line 28 def copy_initializer template "roomer.rb", "config/initializers/roomer.rb" end |
#shared_schema_name ⇒ Symbol
Reads the shared-schema-name and assigns it to Roomer.shared_schema_name
23 24 25 |
# File 'lib/generators/roomer/install/install_generator.rb', line 23 def shared_schema_name Roomer.shared_schema_name ||= [:shared_schema_name].to_s end |
#show_readme ⇒ Object
Displays the instructions for setting up Roomer
33 34 35 |
# File 'lib/generators/roomer/install/install_generator.rb', line 33 def show_readme readme "README" if behavior == :invoke end |
#tenants_table ⇒ Symbol
Reads the tenants-table option and assigns it to Roomer.tenants_table config parameter
17 18 19 |
# File 'lib/generators/roomer/install/install_generator.rb', line 17 def tenants_table Roomer.tenants_table ||= [:tenants_table].to_s end |