Displaying 1 result from an estimated 1 matches for "has_specific_sysoid".
2010 Jun 24
3
DRY a named scope
Is there a way to DRY this up a bit?
named_scope :has_valid_sysoid, lambda{|sysoid|
(sysoid.nil?) ? {:conditions => ["nodesysoid IS NOT NULL AND
nodelabel LIKE ''%-to-%''"], :include => [:ipinterface, :alarm]} :
{:conditions => ["nodesysoid IS NOT NULL AND nodelabel LIKE ''%-to-%''
AND nodesysoid = ? ", sysoid], :include =>