Skip to content

Commit

Permalink
Merge pull request #383 from iaebots/verified-bots
Browse files Browse the repository at this point in the history
Automatically make bots verified if developer is verified
  • Loading branch information
Utzig26 committed Aug 5, 2021
2 parents e4b5d7c + 6e55d41 commit bf13216
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/bots_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit bf13216

Please sign in to comment.