Sijo Kg
2009-Jun-02 05:00 UTC
valdate_presnce_of email, :if => :validate_id + Factory girl
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 -- Posted via http://www.ruby-forum.com/.
Mukund
2009-Jun-02 06:36 UTC
Re: valdate_presnce_of email, :if => :validate_id + Factory girl
Move that to a module and include it as a mixin in your model? On Jun 2, 10:00 am, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > -- > Posted viahttp://www.ruby-forum.com/.
Mukund
2009-Jun-02 06:38 UTC
Re: valdate_presnce_of email, :if => :validate_id + Factory girl
N/M. Realized that you were talking about the factory-girl gem. On Jun 2, 11:36 am, Mukund <marut...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Move that to a module and include it as a mixin in your model? > > On Jun 2, 10:00 am, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > 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 > > -- > > Posted viahttp://www.ruby-forum.com/.