mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	 f590539b9b
			
		
	
	f590539b9b
	
	
	
		
			
			## 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>
		
			
				
	
	
		
			10 lines
		
	
	
		
			422 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			422 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # Add your own tasks in files placed in lib/tasks ending in .rake,
 | |
| # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
 | |
| 
 | |
| require_relative 'config/application'
 | |
| # Load Enterprise Edition rake tasks if they exist
 | |
| enterprise_tasks_path = Rails.root.join('enterprise/tasks_railtie.rb').to_s
 | |
| require enterprise_tasks_path if File.exist?(enterprise_tasks_path)
 | |
| 
 | |
| Rails.application.load_tasks
 |