refactoring recaptcha

This commit is contained in:
rgarcia
2015-07-24 19:55:09 +02:00
committed by Juanjo Bazán
parent 034c62f3b9
commit daab640dd2
5 changed files with 36 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
class DebatesController < ApplicationController
include RecaptchaHelper
before_action :set_debate, only: [:show, :edit, :update]
before_action :authenticate_user!, except: [:show, :index]
before_action :validate_ownership, only: [:edit, :update]
@@ -51,7 +52,7 @@ class DebatesController < ApplicationController
end
def verify_captcha?
return true unless Rails.application.secrets.recaptcha_public_key
return true unless recaptcha_keys?
verify_recaptcha(model: @debate)
end