Class: Roomer::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/roomer/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject

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_nameSymbol

Reads the shared-schema-name and assigns it to Roomer.shared_schema_name

Returns:

  • (Symbol)

    shared schema name



23
24
25
# File 'lib/generators/roomer/install/install_generator.rb', line 23

def shared_schema_name
  Roomer.shared_schema_name ||= options[:shared_schema_name].to_s
end

#show_readmeObject

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_tableSymbol

Reads the tenants-table option and assigns it to Roomer.tenants_table config parameter

Returns:

  • (Symbol)

    tenants table name



17
18
19
# File 'lib/generators/roomer/install/install_generator.rb', line 17

def tenants_table
  Roomer.tenants_table ||= options[:tenants_table].to_s
end