Module: Card::Set::All::ResetMachines::ClassMethods

Defined in:
tmpsets/set/mod014-machines/all/reset_machines.rb

Instance Method Summary collapse

Instance Method Details

#reset_all_machinesObject



20
21
22
23
24
25
26
27
28
# File 'tmpsets/set/mod014-machines/all/reset_machines.rb', line 20

def reset_all_machines
  Auth.as_bot do
    Card.search(right: { codename: "machine_output" }).each do |card|
      card.update_columns trash: true
      card.expire
    end
    Card::Virtual.where(right_id: MachineCacheID).delete_all
  end
end

#reset_script_machineObject



9
10
11
12
13
14
15
16
17
18
# File 'tmpsets/set/mod014-machines/all/reset_machines.rb', line 9

def reset_script_machine
  Auth.as_bot do
    card = Card[:all, :script, :machine_output]
    if card
      card.update_columns trash: true
      card.expire
      Card::Virtual.where(right_id: MachineCacheID).delete_all
    end
  end
end