From 927333f4f89403c5a6a2b421065112e517d88193 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 29 Sep 2016 21:28:21 +0200 Subject: Improve code style --- app/controllers/api/subscriptions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/api/subscriptions_controller.rb') diff --git a/app/controllers/api/subscriptions_controller.rb b/app/controllers/api/subscriptions_controller.rb index c8fa60260..c5190b136 100644 --- a/app/controllers/api/subscriptions_controller.rb +++ b/app/controllers/api/subscriptions_controller.rb @@ -4,7 +4,7 @@ class Api::SubscriptionsController < ApiController def show if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic']) - @account.update(subscription_expires_at: Time.now + ((params['hub.lease_seconds'] || 86400).to_i).seconds) + @account.update(subscription_expires_at: Time.now.utc + (params['hub.lease_seconds'] || 86_400).to_i.seconds) render plain: HTMLEntities.new.encode(params['hub.challenge']), status: 200 else head 404 @@ -15,7 +15,7 @@ class Api::SubscriptionsController < ApiController body = request.body.read if @account.subscription(api_subscription_url(@account.id)).verify(body, request.headers['HTTP_X_HUB_SIGNATURE']) - ProcessFeedService.new.(body, @account) + ProcessFeedService.new.call(body, @account) head 201 else head 202 -- cgit