assemblymade/coderwall

View on GitHub
app/services/user_banner_service.rb

Summary

Maintainability
A
0 mins
Test Coverage
class UserBannerService
  def self.ban(user)
    user.update_attribute(:banned_at, Time.now.utc)
    UserProtipsService.deindex_all_for(user)
    UserCommentsService.deindex_all_for(user)
  end

  def self.unban(user)
    user.update_attribute(:banned_at, nil)
    UserProtipsService.reindex_all_for(user)
  end
end