Class: Killbill::Zendesk::ZendeskPlugin
- Inherits:
-
Plugin::Notification
- Object
- Plugin::Notification
- Killbill::Zendesk::ZendeskPlugin
- Defined in:
- lib/zendesk.rb
Instance Attribute Summary collapse
-
#updater ⇒ Object
readonly
For testing.
Instance Method Summary collapse
Instance Attribute Details
#updater ⇒ Object (readonly)
For testing
16 17 18 |
# File 'lib/zendesk.rb', line 16 def updater @updater end |
Instance Method Details
#after_request ⇒ Object
23 24 25 26 |
# File 'lib/zendesk.rb', line 23 def after_request # return DB connections to the Pool if required ::ActiveRecord::Base.connection.close if ::ActiveRecord::Base.connection_pool.active_connection? end |
#on_event(event) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/zendesk.rb', line 28 def on_event(event) if @updater.nil? logger.warn "ZendeskPlugin wasn't started properly - check logs" return end @updater.update(event.account_id) if [:ACCOUNT_CREATION, :ACCOUNT_CHANGE].include?(event.event_type) end |
#start_plugin ⇒ Object
18 19 20 21 |
# File 'lib/zendesk.rb', line 18 def start_plugin super @updater = Killbill::Zendesk::UserUpdaterInitializer.instance.initialize!(@conf_dir, @kb_apis, @logger) end |