Class: NetworkUserSyncJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- NetworkUserSyncJob
- Defined in:
- app/jobs/network_user_sync_job.rb
Overview
Synchronize user with main site
Instance Method Summary collapse
Instance Method Details
#perform(entity_id, for_update = false) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/jobs/network_user_sync_job.rb', line 9 def perform(entity_id, for_update = false) return unless Rails.env.production? entity = User.find_by(id: entity_id) return if entity.nil? handler = NetworkManager::UserHandler.new for_update ? handler.update_remote(entity) : handler.create_remote(entity) end |