Changeset 186

Show
Ignore:
Timestamp:
07/30/08 15:55:11 (4 months ago)
Author:
pwh
Message:
  • app/models/device.rb: Add a method, has_inventory?, which will return
    true if this device has some L2Interfaces recorded against it, or false
    otherwise.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/models/device.rb

    r168 r186  
    157157 
    158158  end 
    159  
     159   
     160   
     161  # Check if a device has an inventory. 
     162   
     163  def has_inventory? 
     164   
     165    return true if self.l2_interfaces.count > 0 
     166    return false if self.l2_interfaces.count == 0 
     167   
     168  end 
    160169 
    161170