lib/localeapp/rails/controller.rb in localeapp-1.0.2 vs lib/localeapp/rails/controller.rb in localeapp-2.0.0
- old
+ new
@@ -1,10 +1,15 @@
module Localeapp
module Rails
module Controller
def self.included(base)
- base.before_filter :handle_translation_updates
- base.after_filter :send_missing_translations
+ if base.respond_to? :before_action
+ base.before_action :handle_translation_updates
+ base.after_action :send_missing_translations
+ else
+ base.before_filter :handle_translation_updates
+ base.after_filter :send_missing_translations
+ end
end
def handle_translation_updates
raise Localeapp::MissingApiKey unless ::Localeapp.configuration.has_api_key?
unless ::Localeapp.configuration.polling_disabled?