Validation of encrypted data
问题 I encrypt all private data of users before storing in database with help of gem 'attr_encrypted'. For example, I have 'email_addresses' table, which contains 'encrypted_email' column. This gem decrypt data when I call object.email or when I search by emails. But I have issues with validation of this column. I have following validations for this and other tables: validates_length_of :email, :within => 3..100 validates_numericality_of :post_code I should decrypt data before validation somehow,