Pål Bergström wrote:
> Brian Mr wrote:
>> Pål Bergström wrote:
> 
>> y = myrecord.myattribute
>> 
>> y now holds the unencypted value.
> 
> Got it working with this in the model:
> 
> before_save :crypt_data
> after_save :decrypt_data
> after_find :decrypt_data
> define_method(:after_find) { }
> 
> Works perfect.
> 
> Just one more thing. How do I deal with search? I have a solution but 
> perhaps I'm not doing it right.
> 
> I have a custom decrypt on the data before the find using %string% and 
> LIKE, but it must be full words as the columns holds the encrypted data. 
> Anyway around this?

Sorry, don't have an answer for that.  If nobody else replies, you might 
want to post a new question for that. Glad the got the rest working!

b

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to