mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 02:02:27 +00:00
## Description This PR sets up an `Enterprise::Railtie` to correctly register rake tasks in the `enterprise` namespace. Previously, rake tasks under `enterprise/lib/tasks` were being eagerly loaded at Rails boot, causing `undefined method 'namespace'` errors. With this change, rake tasks are now registered only in the rake context, avoiding boot-time issues and ensuring they are discoverable with `bin/rake -T`. **Tasks added:** * `search:all` → Reindex messages for all accounts * `search:account[ID]` → Reindex messages for a specific account Fixes: #12414 Co-authored-by: Sojan Jose <sojan@pepalo.com>
9 lines
229 B
Ruby
9 lines
229 B
Ruby
# frozen_string_literal: true
|
|
|
|
class TasksRailtie < Rails::Railtie
|
|
rake_tasks do
|
|
# Load all rake tasks from enterprise/lib/tasks
|
|
Dir.glob(Rails.root.join('enterprise/lib/tasks/**/*.rake')).each { |f| load f }
|
|
end
|
|
end
|