Valdate_presnce_of email, :if => :validate_id + Factory girl


#1

Hi
In the model I have User
attr_accessor :validate_email_id
validates_presence_of :email ,:if => :validate_email_id
Could anybody please tell me how can I define a Factory for the above?

Thanks in advance
Sijo


#2

Move that to a module and include it as a mixin in your model?


#3

N/M. Realized that you were talking about the factory-girl gem.


#4

Mukund wrote:

Move that to a module and include it as a mixin in your model?
Did not understand this.Could you please elaborate?
Sijo