Validate_presence_of on 'has_many' and 'belongs_to' association how to write factory


0 votes
asked Mar 4, 2016 by vgf_Say (990 points)
Thanks for your attention

5 Answers

0 votes
answered Apr 5, 2016 by fub_i (980 points)

Or, better, use a factory that sets this for you automatically.
commented Apr 6, 2016 by supported (500 points)
I have myself been looking into this problem
0 votes
answered Apr 22, 2016 by Colantro (330 points)
I just looked at code that did this today
Also check Active Record Validations Ruby on Rails Guides for further reference
0 votes
answered May 20, 2016 by N1774 (180 points)
I just looked at code that did this today
Also check Active Record Validations Ruby on Rails Guides for further reference
0 votes
answered May 24, 2016 by zeranhashing (1,130 points)
Read the excellent article at Shoulda Matchers 2.6.0 - thoughtbot for a lot more information
The source codes are available here
+1 vote
answered May 24, 2016 by Hickin (560 points)
There is a problem with this response. The only issue is that they may have to log in first

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!







...