From 6e55d4118482f0951861cdb4acacc631f175985d Mon Sep 17 00:00:00 2001 From: Daniel M Brasil Date: Thu, 5 Aug 2021 19:03:25 -0300 Subject: [PATCH] automatically make bot verified if developer is verified --- app/controllers/bots_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/bots_controller.rb b/app/controllers/bots_controller.rb index fa80d25..e57c83a 100644 --- a/app/controllers/bots_controller.rb +++ b/app/controllers/bots_controller.rb @@ -4,6 +4,7 @@ class BotsController < ApplicationController before_action :find_bot, only: %i[follow unfollow show destroy regenerate_keys edit update] before_action :confirmed?, only: %i[new] + after_action :verify_bot, only: :create # Follow a bot def follow @@ -103,4 +104,8 @@ def confirmed? flash[:notice] = I18n.t('bots.registrations.new.email_confirmation') redirect_to developer_path(current_developer) end + + def verify_bot + @bot.update_attribute(:verified, true) if @bot.developer.verified? + end end