Re: [Rails] Re: Validate uniqueness of association not working.

2015-09-14 Thread Colin Law
On 14 September 2015 at 15:13, Luis wrote: > There is no unit test for this. Then the solution is obvious. Write one. Colin > > > On Friday, September 11, 2015 at 11:43:39 AM UTC-4, Luis wrote: >> >> Hi! >> >> I have the following classes for postgres rails 4 project : >> >> class Medhospita

[Rails] Re: Validate uniqueness of association not working.

2015-09-14 Thread Luis
There is no unit test for this. On Friday, September 11, 2015 at 11:43:39 AM UTC-4, Luis wrote: > > Hi! > > I have the following classes for postgres rails 4 project : > > class Medhospital < ActiveRecord::Base > belongs_to :pcp > belongs_to :hospital > validates_uniqueness_of :pcp_id, :s

Re: [Rails] Re: Validate uniqueness of association not working.

2015-09-14 Thread Colin Law
On 14 September 2015 at 01:04, Luis wrote: > That is all I have, The controller have nothing special all is basic and > default. Well not quite, I am using > > cocoon gem for the nested forms but other than that is pretty vanilla. Please quote the previous message when replying, it makes it easie

[Rails] Re: Validate uniqueness of association not working.

2015-09-13 Thread Luis
That is all I have, The controller have nothing special all is basic and default. Well not quite, I am using cocoon gem for the nested forms but other than that is pretty vanilla. Thanks. class PcpsController < ApplicationController before_action :set_pcp, only: [:show, :edit, :update,