@@ -47,14 +47,14 @@ class Engine < ::Rails::Engine
4747 initializer 'better_together.importmap' , before : 'importmap' do |app |
4848 app . config . importmap . paths << Engine . root . join ( 'config/importmap.rb' )
4949
50- # NOTE: something about cache; I did not look into it.
51- # https://github.com/rails/importmap-rails#sweeping-the-cache-in-development-and-test
50+ # Ensure the cache is swept in development and test environments
5251 app . config . importmap . cache_sweepers << root . join ( 'app/assets/javascripts' )
52+ app . config . importmap . cache_sweepers << root . join ( 'app/javascript' )
5353 end
5454
55- # NOTE: add engine manifest to precompile assets in production
55+ # Add engine manifest to precompile assets in production
5656 initializer 'better_together.assets' do |app |
57- app . config . assets . precompile += %w[ better_together_manifest ]
57+ app . config . assets . precompile += %w[ better_together_manifest.js ]
5858 app . config . assets . paths << root . join ( 'app' , 'assets' , 'images' )
5959 app . config . assets . paths << root . join ( 'app' , 'javascript' )
6060 end
@@ -63,6 +63,11 @@ class Engine < ::Rails::Engine
6363 app . config . action_view . form_with_generates_remote_forms = true
6464 end
6565
66+ # Add custom logging
67+ initializer 'better_together.logging' , before : :initialize_logger do |app |
68+ app . config . log_tags = [ :request_id , :remote_ip ]
69+ end
70+
6671 rake_tasks do
6772 load 'tasks/better_together_tasks.rake'
6873
0 commit comments