Module: Staypuft::Concerns::NicBondingExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/staypuft/concerns/nic_bonding_extensions.rb

Instance Method Summary collapse

Instance Method Details

#ensure_macObject



10
11
12
13
14
# File 'app/models/staypuft/concerns/nic_bonding_extensions.rb', line 10

def ensure_mac
  mac_addresses = self.host.interfaces.where(
      :identifier => attached_devices_identifiers).pluck(:mac).compact
  self.mac =  mac_addresses.first unless mac_addresses.include?(self.mac)
end