questions about validations

2008-05-26 Thread dusty
Is there an :if option available with validations? I am trying to reproduce the restful_authentication plugin to work with sequel and using something like this. attr_accessor :password validates_presence_of :password, :if = :password_required? protected def password_required?

Re: questions about validations

2008-05-26 Thread dusty
Ok, thanks. I'll give not_naughty a shot! Funny name :) On May 26, 11:28 am, Jeremy Evans [EMAIL PROTECTED] wrote: On May 26, 8:20 am, dusty [EMAIL PROTECTED] wrote: Is there an :if option available with validations?  I am trying to reproduce the restful_authentication plugin to work

changed_columns with after callback

2008-05-26 Thread dusty
I am using the changed_columns method to fire off an action after a save, if a particular column was changed. For example: after_save do send_email_activation end def send_email_activation self.send_activation_request if self.changed_columns.include? (:email) end However, that

Re: allow_null with typecast

2008-05-26 Thread Jeremy Evans
On May 25, 11:00 am, dusty [EMAIL PROTECTED] wrote: I have a timestamp field in my model that I want to allow null on, I'm not sure how to do this. Right now I have it with :allow_null = true in my set_schema declaration. However, when I set that attribute to nil and save the record, I get

Re: changed_columns with after callback

2008-05-26 Thread Jeremy Evans
On May 26, 8:28 am, dusty [EMAIL PROTECTED] wrote: I am using the changed_columns method to fire off an action after a save, if a particular column was changed. For example: after_save do send_email_activation end def send_email_activation self.send_activation_request if

Re: questions about validations

2008-05-26 Thread Jeremy Evans
On May 26, 8:20 am, dusty [EMAIL PROTECTED] wrote: Is there an :if option available with validations? I am trying to reproduce the restful_authentication plugin to work with sequel and using something like this. attr_accessor :password validates_presence_of :password, :if =

Re: allow_null with typecast

2008-05-26 Thread dusty
Great, thanks! I was using sequel a while back and am now starting to get back into it. Excited about all these new changes. Its looking real good. -Dusty On May 26, 11:21 am, Jeremy Evans [EMAIL PROTECTED] wrote: On May 25, 11:00 am, dusty [EMAIL PROTECTED] wrote: I have a timestamp

Re: Model Plugins Removal

2008-05-26 Thread Jeremy Evans
On May 22, 12:13 pm, Jeremy Evans [EMAIL PROTECTED] wrote: I plan on removing the model_plugins directory from the master repository. I don't support any of plugins there and don't test any of them. They are basically just deadweight as far as I am concerned. Anyone wishing to maintain one