lib/open_project/account_expiry/lock_task.rb
##
# Perform the lock requested in this task
Perform the lock requested in this task
Perform the lock requested in this task
def perform(verbose = false)
      affected = User.where(
        'expiration_date IS NOT NULL AND expiration_date <= ?',
        lockdate
      )
      if affected.empty? && verbose
        puts 'No users eligible for locking.'
      end
      affected.each do |user|
        puts "Locking user #{user.login} (##{user.id})" if verbose
        user.lock! unless user.locked?
      end
      affected
    end
def perform ( verbose = false ) affected = User . where ( 'expiration_date IS NOT NULL AND expiration_date <= ?' , lockdate ) if affected . empty? && verbose puts 'No users eligible for locking.' end affected . each do | user | puts "Locking user #{user.login} (##{user.id})" if verbose user . lock! unless user . locked? end affected end
Perform the lock requested in this task
Perform the lock requested in this task
verbose