chatwoot/app/views/fields
Shivam Mishra 824164852c
refactor: extract custom attribute methods from FilterService (#13743)
- Extracted 6 custom attribute methods (`custom_attribute_query`,
`attribute_model`, `attribute_data_type`, `build_custom_attr_query`,
`custom_attribute`, `not_in_custom_attr_query`) into a new
`Filters::CustomAttributeFilterHelper` module.
- Added an inline `rubocop:disable` for the intentional
`Lint/ShadowedException` in `coerce_lt_gt_value` — `Date::Error` is a
subclass of `ArgumentError`, but both are listed explicitly for clarity.

## Why `app/services/filters/`

The existing `Filters::FilterHelper` lives in `app/helpers/filters/`,
but that location triggers `Rails/HelperInstanceVariable` for any module
that uses instance variables. The extracted methods share state with
`FilterService` via instance variables (`@attribute_key`, `@account`,
`@custom_attribute`, etc.), so placing them in `app/helpers/` would
require a cop disable.

`app/services/filters/` is a better fit because:
- The module is a service mixin, not a view helper — it's only included
by `FilterService` and its subclasses (`Conversations::FilterService`,
`Contacts::FilterService`, `AutomationRules::ConditionsFilterService`).
- It sits alongside the services that use it.
- No cop disables needed.

---------

Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
2026-03-10 14:15:52 +05:30
..
avatar_field fix: SuperAdmin Improvements (#3733) 2022-01-11 19:00:00 -08:00
belongs_to Chore: Remove deprecation warning post rails upgrade (#7080) 2023-05-15 16:32:27 +05:30
belongs_to_search chore: Improve search in super admin panel (#7952) 2023-09-22 19:41:13 +05:30
confirmed_at_field refactor: extract custom attribute methods from FilterService (#13743) 2026-03-10 14:15:52 +05:30
count_field Feature: Rewamp super admin dashboard (#882) 2020-05-24 22:44:26 +05:30
polymorphic Chore: Remove deprecation warning post rails upgrade (#7080) 2023-05-15 16:32:27 +05:30
secret_field feat: Hide installation identifier (#11722) 2025-06-17 15:45:40 -07:00
serialized_field feat: installation config in super admin console (#1641) 2021-01-15 13:21:53 +05:30