Sha256: 75b81b2bd36d121b03877c9fa5c0a847fafc7bfc0fac72f607f723ab0fbb13e7
Contents?: true
Size: 686 Bytes
Versions: 28
Compression:
Stored size: 686 Bytes
Contents
require 'rest-client' module Sync class ReceiptTemplatesWorker include Sidekiq::Worker sidekiq_options :retry => false, :queue => :sync def perform params = { :terminal => Terminal.config.keyword } response = RestClient.get "#{Terminal.config.host}/system_receipt_templates?#{params.to_query}" templates = JSON.parse(response.to_s, :symbolize_names => true) templates.each do |entry| Sidekiq::Logging.logger.info "Got #{entry[:keyword]} receipt template" ReceiptTemplate.find_or_create_by_keyword(entry[:keyword]). update_attributes :template => entry[:template] end nil end end end
Version data entries
28 entries across 28 versions & 1 rubygems