class Bulldozer::DbOptimizationsGenerator

Public Instance Methods

add_bullet() click to toggle source
# File lib/bulldozer/generators/db_optimizations_generator.rb, line 5
def add_bullet
  gem "bullet", group: %i(development test)
  Bundler.with_clean_env { run "bundle install" }
end
configure_bullet() click to toggle source
# File lib/bulldozer/generators/db_optimizations_generator.rb, line 10
def configure_bullet
  inject_into_file(
    "config/environments/development.rb",
    configuration,
    after: "config.action_mailer.raise_delivery_errors = true\n",
  )
end

Private Instance Methods

configuration() click to toggle source
# File lib/bulldozer/generators/db_optimizations_generator.rb, line 20
    def configuration
      <<-RUBY
  config.after_initialize do
    Bullet.enable = true
    Bullet.bullet_logger = true
    Bullet.rails_logger = true
  end
      RUBY
    end