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?
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
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
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
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
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 =
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
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