Re: [Rails] Validation in a 3-level association

2014-07-14 Thread Hassan Schroeder
On Mon, Jul 14, 2014 at 6:07 AM, Ronald Fischer wrote: > I have 3 models, say A, B and C, and they are set up like this: > > A: > has_many :Bs > has_many :Cs, through: B > In my model for C, I want to declare, that a column ccol within C must > be unique, but only within the scope of a certai

[Rails] Validation in a 3-level association

2014-07-14 Thread Ronald Fischer
I have 3 models, say A, B and C, and they are set up like this: A: has_many :Bs has_many :Cs, through: B B: belongs_to A: has_many :Cs C: belongs_to B: In my model for C, I want to declare, that a column ccol within C must be unique, but only within the scope of a certain A. If the c