diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb index 223f96438..d3a8ff7b1 100644 --- a/app/controllers/long_polling_controller.rb +++ b/app/controllers/long_polling_controller.rb @@ -1,7 +1,7 @@ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ class LongPollingController < ApplicationController - skip_filter :session_update + skip_action_callback :session_update # prevent race conditions # GET /api/v1/message_send def message_send diff --git a/app/models/translation.rb b/app/models/translation.rb index 0f10fffff..d36c05ad8 100644 --- a/app/models/translation.rb +++ b/app/models/translation.rb @@ -218,9 +218,11 @@ translate strings in ruby context, e. g. for notifications def cache_clear Cache.delete( 'TranslationMap::' + locale.downcase ) end + def self.cache_set(locale, data) Cache.write( 'TranslationMap::' + locale.downcase, data ) end + def self.cache_get(locale) Cache.get( 'TranslationMap::' + locale.downcase ) end diff --git a/test/integration/elasticsearch_test.rb b/test/integration/elasticsearch_test.rb index 770ecf07e..7fbd4cfe3 100644 --- a/test/integration/elasticsearch_test.rb +++ b/test/integration/elasticsearch_test.rb @@ -121,7 +121,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: File.open("#{Rails.root}/test/fixtures/es-normal.txt", 'rb') { |file| file.read }, + data: IO.read("#{Rails.root}/test/fixtures/es-normal.txt"), filename: 'es-normal.txt', preferences: {}, created_by_id: 1, @@ -132,7 +132,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: File.open("#{Rails.root}/test/fixtures/es-pdf1.pdf", 'rb') { |file| file.read }, + data: IO.read("#{Rails.root}/test/fixtures/es-pdf1.pdf"), filename: 'es-pdf1.pdf', preferences: {}, created_by_id: 1, @@ -143,7 +143,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: File.open("#{Rails.root}/test/fixtures/es-box1.box", 'rb') { |file| file.read }, + data: IO.read("#{Rails.root}/test/fixtures/es-box1.box"), filename: 'mail1.box', preferences: {}, created_by_id: 1, @@ -154,7 +154,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: File.open("#{Rails.root}/test/fixtures/es-too-big.txt", 'rb') { |file| file.read }, + data: IO.read("#{Rails.root}/test/fixtures/es-too-big.txt"), filename: 'es-too-big.txt', preferences: {}, created_by_id: 1,