TITLE: Inverse of the Structure Theorem for Finitely Generated Modules over PID
QUESTION [13 upvotes]: We know that for a PID $R$, any finitely generated module is of the form $\frac{R}{(a_1)} \oplus \dots \oplus \frac{R}{(a_s)} $.
I was wondering if the converse of this statement is true, that is, is it true that for a domain $R$, if any f.g. module is isomorphic to $\frac{R}{I_1} \oplus \dots \oplus \frac{R}{I_s}$ for ideals $I_i \triangleleft R $, must $R$ be a PID? 
I know that a counter example to the above statement must be non Noetherian (and infact, it must be that any non-principal ideal is not f.g.) because if $I = (a_1, ..., a_n)$ is a non principal f.g. ideal, that it is a torsion free $R$ module, but it isn't free, since $x_1, ... x_m$ are not linearly independent if $m > 1$ since $x_2 x_1 + (-x_1)x_2 = 0$, hence they do not form a basis. 
PS: I would generally like $R$ to be commutative unitial and an integral domain, but I would love to know even for other cases.

REPLY [12 votes]: There seems to be quite some literature about rings with this property, sometimes under the name "FGC domains".
From Googling, not personal knowledge:
In Theorem 14 of
Kaplansky, Irving, Modules over Dedekind rings and valuation rings, Trans. Am. Math. Soc. 72, 327-340 (1952). ZBL0046.25701, it is proved that an almost maximal valuation domain has this property.
"Maximal" means that a system $x\equiv a_i\pmod{I_i}$ of congruences has a solution if each pair of the congruences has a solution, and "almost maximal" is the same, but only for such systems of congruences with $\bigcap_iI_i\neq0$. I'm not sure what the simplest example is that is not a PID, but I guess the completion of $R=k[x^\alpha\mid 0<\alpha\in\mathbb{Q}]$ with respect to the set of ideals $x^\alpha R$ is a maximal valuation domain.
Osofsky constructed an example of an FGC domain that is neither a PID nor a valuation domain, and work of many people, culminating in
Brandal, Willy; Wiegand, Roger, Reduced rings whose finitely generated modules decompose, Commun. Algebra 6, 195-201 (1978). ZBL0368.13005, led to the theorem that FGC domains are precisely the almost maximal Bezout domains.
And there's a whole Springer Lecture Notes volume by Brandal on the not-necessarily-domain case:
Brandal, Willy, Commutative rings whose finitely generated modules decompose, Lecture Notes in Mathematics. 723. Berlin-Heidelberg-New York: Springer-Verlag. 116 p. (1979). ZBL0426.13004.