Skip to content

Commit

Permalink
Fix: Wrap Rails integrations into AS::Callback (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
zealot128 authored Sep 27, 2024
1 parent 616e653 commit 993c7c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/datagrid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ module Datagrid
autoload :Configuration

autoload :Helper
ActionView::Base.send(:include, Datagrid::Helper)
::ActiveSupport.on_load(:action_view) do
ActionView::Base.send(:include, Datagrid::Helper)
end

autoload :FormBuilder
ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder)
::ActiveSupport.on_load(:action_view) do
ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder)
end

autoload :Renderer

Expand Down

3 comments on commit 993c7c1

@zhuravel
Copy link
Contributor

@zhuravel zhuravel commented on 993c7c1 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogdan FYI this commit broke our tests that render views.

A very simplified example of a test that was passing prior to this commit:

require "spec_helper"

RSpec.describe Staff::ReportsController do
  render_views

  before do
    login_staff_user
    create(:site, focused: true, account: create(:account))
  end

  specify "#customer_health" do
    get :customer_health
    expect(response).to be_successful
  end
end

Test result after this change:

Randomized with seed: 24650

  1) Staff::ReportsController #customer_health
     Failure/Error: = f.datagrid_filter :monthly_licensing_cost, size: 6, maxlength: 6

     ActionView::Template::Error:
       Missing partial datagrid/_range_filter with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :haml]}.

       Searched in:
         * "/Users/bohdan/Projects/talkable/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/passkit-cc0f14ee2070/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/bootstrap-kaminari-views-0.0.5/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/kaminari-core-1.2.2/app/views"
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/path_set.rb:42:in `find'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/lookup_context.rb:131:in `find'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/partial_renderer.rb:264:in `find_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/partial_renderer.rb:231:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:78:in `render_partial_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:24:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:308:in `in_rendering_context'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/rendering_helper.rb:33:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:225:in `render_partial'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:158:in `datagrid_range_filter'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:107:in `datagrid_integer_filter'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:14:in `datagrid_filter'
     # ./app/views/staff/reports/customer_health.html.haml:23:in `block in _app_views_staff_reports_customer_health_html_haml___3780001133733110713_46040'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/capture_helper.rb:50:in `block in capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/buffers.rb:75:in `capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/capture_helper.rb:50:in `capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/form_helper.rb:775:in `form_with'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/form_helper.rb:462:in `form_for'
     # ./app/views/staff/reports/customer_health.html.haml:12:in `_app_views_staff_reports_customer_health_html_haml___3780001133733110713_46040'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:281:in `public_send'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:281:in `_run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:275:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:574:in `instrument_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:263:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:76:in `block in render_with_layout'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:11:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:58:in `render_template_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:135:in `block in _render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:308:in `in_rendering_context'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:134:in `_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/streaming.rb:258:in `_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:121:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:186:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/rendering.rb:29:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:167:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:32:in `block (2 levels) in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/core_ext/benchmark.rb:14:in `ms'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:32:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:101:in `cleanup_view_runtime'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/railties/controller_runtime.rb:46:in `cleanup_view_runtime'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:31:in `render'
     # ./app/controllers/merchant_controller.rb:26:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/implicit_render.rb:39:in `default_render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/basic_implicit_render.rb:9:in `send_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/base.rb:226:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:193:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/callbacks.rb:261:in `block in process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
     # ./app/controllers/application_controller.rb:198:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/controllers/application_controller.rb:198:in `use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/core_ext/time/zones.rb:65:in `use_zone'
     # ./app/controllers/pages_controller.rb:47:in `set_time_zone'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # ./app/controllers/application_controller.rb:251:in `add_site_to_newrelic'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:36:in `use_shard'
     # ./app/controllers/concerns/generic_controller_features.rb:11:in `reset_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/react-rails-3.2.1/lib/react/rails/controller_lifecycle.rb:33:in `use_react_component_helper'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:141:in `run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/callbacks.rb:260:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rescue.rb:27:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:76:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/railties/controller_runtime.rb:39:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/base.rb:163:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:40:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal.rb:252:in `dispatch'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:631:in `block in process_controller_response'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:621:in `wrap_execution'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:631:in `process_controller_response'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:541:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:62:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:430:in `get'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/integration.rb:16:in `block (2 levels) in <module:Integration>'
     # ./spec/controllers/staff/reports_controller_spec.rb:17:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:89:in `block (3 levels) in <top (required)>'
     # ./app/services/database_utils.rb:319:in `block (2 levels) in transaction_with_rollback'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:233:in `transaction'
     # ./config/initializers/active_record_sharding.rb:121:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/services/database_utils.rb:196:in `use_master'
     # ./config/initializers/active_record_sharding.rb:119:in `transaction'
     # ./app/services/database_utils.rb:318:in `block in transaction_with_rollback'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:233:in `transaction'
     # ./config/initializers/active_record_sharding.rb:121:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/services/database_utils.rb:196:in `use_master'
     # ./config/initializers/active_record_sharding.rb:119:in `transaction'
     # ./app/services/database_utils.rb:317:in `transaction_with_rollback'
     # ./spec/spec_helper.rb:89:in `block (2 levels) in <top (required)>'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # ------------------
     # --- Caused by: ---
     # ActionView::MissingTemplate:
     #   Missing partial datagrid/_range_filter with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :haml]}.
     #
     #   Searched in:
     #     * "/Users/bohdan/Projects/talkable/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/passkit-cc0f14ee2070/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/bootstrap-kaminari-views-0.0.5/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/kaminari-core-1.2.2/app/views"
     #   /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/path_set.rb:42:in `find'
F...

Failures:

  1) Staff::ReportsController #customer_health
     Failure/Error: = f.datagrid_filter :monthly_licensing_cost, size: 6, maxlength: 6

     ActionView::Template::Error:
       Missing partial datagrid/_range_filter with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :haml]}.

       Searched in:
         * "/Users/bohdan/Projects/talkable/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/passkit-cc0f14ee2070/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/bootstrap-kaminari-views-0.0.5/app/views"
         * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/kaminari-core-1.2.2/app/views"
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/path_set.rb:42:in `find'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/lookup_context.rb:131:in `find'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/partial_renderer.rb:264:in `find_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/partial_renderer.rb:231:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:78:in `render_partial_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:24:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:308:in `in_rendering_context'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/rendering_helper.rb:33:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:225:in `render_partial'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:158:in `datagrid_range_filter'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:107:in `datagrid_integer_filter'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/datagrid-993c7c1e7bf2/lib/datagrid/form_builder.rb:14:in `datagrid_filter'
     # ./app/views/staff/reports/customer_health.html.haml:23:in `block in _app_views_staff_reports_customer_health_html_haml___3780001133733110713_46040'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/capture_helper.rb:50:in `block in capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/buffers.rb:75:in `capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/capture_helper.rb:50:in `capture'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/form_helper.rb:775:in `form_with'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/helpers/form_helper.rb:462:in `form_for'
     # ./app/views/staff/reports/customer_health.html.haml:12:in `_app_views_staff_reports_customer_health_html_haml___3780001133733110713_46040'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:281:in `public_send'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:281:in `_run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:275:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:574:in `instrument_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/template.rb:263:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:76:in `block in render_with_layout'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/template_renderer.rb:11:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:58:in `render_template_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/renderer/renderer.rb:31:in `render_to_object'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:135:in `block in _render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/base.rb:308:in `in_rendering_context'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:134:in `_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/streaming.rb:258:in `_render_template'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:121:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:186:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/rendering.rb:29:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:167:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:32:in `block (2 levels) in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/core_ext/benchmark.rb:14:in `ms'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:32:in `block in render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:101:in `cleanup_view_runtime'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/railties/controller_runtime.rb:46:in `cleanup_view_runtime'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:31:in `render'
     # ./app/controllers/merchant_controller.rb:26:in `render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/implicit_render.rb:39:in `default_render'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/basic_implicit_render.rb:9:in `send_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/base.rb:226:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rendering.rb:193:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/callbacks.rb:261:in `block in process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
     # ./app/controllers/application_controller.rb:198:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/controllers/application_controller.rb:198:in `use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/core_ext/time/zones.rb:65:in `use_zone'
     # ./app/controllers/pages_controller.rb:47:in `set_time_zone'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # ./app/controllers/application_controller.rb:251:in `add_site_to_newrelic'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:36:in `use_shard'
     # ./app/controllers/concerns/generic_controller_features.rb:11:in `reset_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/react-rails-3.2.1/lib/react/rails/controller_lifecycle.rb:33:in `use_react_component_helper'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/callbacks.rb:141:in `run_callbacks'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/callbacks.rb:260:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/rescue.rb:27:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `block in instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/notifications.rb:210:in `instrument'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/instrumentation.rb:76:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/railties/controller_runtime.rb:39:in `process_action'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/abstract_controller/base.rb:163:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/rendering.rb:40:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/metal.rb:252:in `dispatch'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:631:in `block in process_controller_response'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:621:in `wrap_execution'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:631:in `process_controller_response'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:541:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:62:in `process'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionpack-7.2.1/lib/action_controller/test_case.rb:430:in `get'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/integration.rb:16:in `block (2 levels) in <module:Integration>'
     # ./spec/controllers/staff/reports_controller_spec.rb:17:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:89:in `block (3 levels) in <top (required)>'
     # ./app/services/database_utils.rb:319:in `block (2 levels) in transaction_with_rollback'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:233:in `transaction'
     # ./config/initializers/active_record_sharding.rb:121:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/services/database_utils.rb:196:in `use_master'
     # ./config/initializers/active_record_sharding.rb:119:in `transaction'
     # ./app/services/database_utils.rb:318:in `block in transaction_with_rollback'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activesupport-7.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/transactions.rb:233:in `transaction'
     # ./config/initializers/active_record_sharding.rb:121:in `block in transaction'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:207:in `block in use_slave'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:376:in `with_role_and_shard'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/activerecord-7.2.1/lib/active_record/connection_handling.rb:147:in `connected_to'
     # ./app/services/database_utils.rb:206:in `use_slave'
     # ./app/services/database_utils.rb:196:in `use_master'
     # ./config/initializers/active_record_sharding.rb:119:in `transaction'
     # ./app/services/database_utils.rb:317:in `transaction_with_rollback'
     # ./spec/spec_helper.rb:89:in `block (2 levels) in <top (required)>'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # ------------------
     # --- Caused by: ---
     # ActionView::MissingTemplate:
     #   Missing partial datagrid/_range_filter with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :haml]}.
     #
     #   Searched in:
     #     * "/Users/bohdan/Projects/talkable/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/bundler/gems/passkit-cc0f14ee2070/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/bootstrap-kaminari-views-0.0.5/app/views"
     #     * "/Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/kaminari-core-1.2.2/app/views"
     #   /Users/bohdan/.rbenv/versions/3.3.5/gemsets/talkable/gems/actionview-7.2.1/lib/action_view/path_set.rb:42:in `find'

Finished in 7.58 seconds (files took 2.6 seconds to load)
4 examples, 1 failure

Failed examples:

rspec ./spec/controllers/staff/reports_controller_spec.rb:16 # Staff::ReportsController #customer_health

Randomized with seed 24650

@bogdan
Copy link
Owner

@bogdan bogdan commented on 993c7c1 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a better way to extend rails described in the rails documentation. Try from current main branch.

@zealot128 can you also try the gem from main if it works correctly for you?

@zhuravel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogdan Confirmed: our test suite passes with the latest main branch. Thanks.

Please sign in to comment.