Class: Bullet::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Bullet::Generators::InstallGenerator
- Defined in:
- lib/generators/bullet/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#enable_in_development ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/generators/bullet/install_generator.rb', line 11 def enable_in_development environment(nil, env: 'development') do " config.after_initialize do\n Bullet.enable = true\n Bullet.alert = true\n Bullet.bullet_logger = true\n Bullet.console = true\n Bullet.rails_logger = true\n Bullet.add_footer = true\n end\n\n FILE\n end\n\n say 'Enabled bullet in config/environments/development.rb'\nend\n" |
#enable_in_test ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/generators/bullet/install_generator.rb', line 29 def enable_in_test return unless yes?('Would you like to enable bullet in test environment? (y/n)') environment(nil, env: 'test') do " config.after_initialize do\n Bullet.enable = true\n Bullet.bullet_logger = true\n Bullet.raise = true # raise an error if n+1 query occurs\n end\n\n FILE\n end\n\n say 'Enabled bullet in config/environments/test.rb'\nend\n" |