Sha256: c06309f417de58b175aa13ed7507189447ea8901a2939439e4bff1a6e72470eb

Contents?: true

Size: 641 Bytes

Versions: 8

Compression:

Stored size: 641 Bytes

Contents

require "rails/generators"

module Suspenders
  class DbOptimizationsGenerator < Rails::Generators::Base
    def add_bullet
      gem "bullet", group: %i(development test)
      Bundler.with_clean_env { run "bundle install" }
    end

    def configure_bullet
      inject_into_file(
        "config/environments/development.rb",
        configuration,
        after: "config.action_mailer.raise_delivery_errors = true\n",
      )
    end

    private

    def configuration
      <<-RUBY
  config.after_initialize do
    Bullet.enable = true
    Bullet.bullet_logger = true
    Bullet.rails_logger = true
  end
      RUBY
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
suspenders-1.50.0 lib/suspenders/generators/db_optimizations_generator.rb
suspenders-1.49.0 lib/suspenders/generators/db_optimizations_generator.rb
welaika-suspenders-2.29.0 lib/suspenders/generators/db_optimizations_generator.rb
suspenders-1.48.0 lib/suspenders/generators/db_optimizations_generator.rb
welaika-suspenders-2.29.0.alpha.3 lib/suspenders/generators/db_optimizations_generator.rb
welaika-suspenders-2.29.0.alpha.2 lib/suspenders/generators/db_optimizations_generator.rb
welaika-suspenders-2.29.0.alpha.1 lib/suspenders/generators/db_optimizations_generator.rb
suspenders-1.47.0 lib/suspenders/generators/db_optimizations_generator.rb