Class: Suspenders::DbOptimizationsGenerator

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/suspenders/generators/db_optimizations_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#add_bulletObject



5
6
7
8
# File 'lib/suspenders/generators/db_optimizations_generator.rb', line 5

def add_bullet
  gem "bullet", group: %i[development test]
  Bundler.with_unbundled_env { run "bundle install" }
end

#configure_bulletObject



10
11
12
13
14
15
16
# File 'lib/suspenders/generators/db_optimizations_generator.rb', line 10

def configure_bullet
  inject_template_into_file(
    "config/environments/development.rb",
    "partials/db_optimizations_configuration.rb",
    after: /config.action_mailer.raise_delivery_errors = .*/
  )
end