[Rails] Re: Re: Re: SQL Server datetime error
Thibaut Barrère
thibaut.barrere at gmail.com
Tue Jan 24 10:35:51 GMT 2006
>
> Thanks for the pointer. However, i wouldn't be in the situation if i'd
> be able to format the date to whatever i want. in my last post i
> described my approach to this problem.
Sounds right :-)
Every approach failed, as i see no change in the datetime format which
> is used to actually save the data. Every hook (callback) i tried didn't
> do the job. I'm unable to say if the fault's on my end.
Did you try putting a breakpoint into before_save to inspect what's
available there ?
Or another hint : I just browsed the doc and it seems that you miss a
parameter to before_save (but I never actually used it, so I may be wrong!)
http://api.rubyonrails.com/classes/ActiveRecord/Callbacks.html#M000652
def before_save(record)
record.credit_card_number = encrypt(record.credit_card_number)
end
Thibaut
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/84b7278a/attachment.html
More information about the Rails
mailing list