Line.joins("a LEFT JOIN attribute_values b ON a.id = b.line_id").select("DISTINCT(a.name)").where("b.value != ? AND b.name in (?) AND a.advertiser_id = ?", 0, [11, 18], 280)
Line.joins("a LEFT JOIN attribute_values b ON a.id = b.line_id").select("DISTINCT(a.name)").where("b.value != ? AND b.name in (?) AND a.advertiser_id = ?", 0, [11, 18], 280)