def max_id_from(s)
      if ! s.respond_to?(:max)
        if s.respond_to?(:id)
          return s.id
        else
          return s
        end       
      end
     
      
      sorted = s.max { |a, b| a.id.to_i <=> b.id.to_i }
      sorted && sorted.id
    end
def max_id_from(s)
      if ! s.respond_to?(:max)
        if s.respond_to?(:id)
          return s.id
        else
          return s
        end       
      end
     
      
      sorted = s.max { |a, b| a.id.to_i <=> b.id.to_i }
      sorted && sorted.id
    end
def max_id_from ( s ) if ! s . respond_to? ( :max ) if s . respond_to? ( :id ) return s . id else return s end end sorted = s . max { | a , b | a . id . to_i <=> b . id . to_i } sorted && sorted . id end
given an array or object, return the highest id we can find
 @param [Enumerable] s the array to check
given an array or object return the highest id we can find