test/sequel_test.rb in attr_encrypted-1.0.9 vs test/sequel_test.rb in attr_encrypted-1.1.0
- old
+ new
@@ -10,10 +10,10 @@
column :salt, :string
end
class Human < Sequel::Model(:humans)
attr_encrypted :email, :key => 'a secret key'
- attr_encrypted :credentials, :key => Proc.new { |human| Huberry::Encryptor.encrypt(:value => human.salt, :key => 'some private key') }, :marshal => true
+ attr_encrypted :credentials, :key => Proc.new { |human| Encryptor.encrypt(:value => human.salt, :key => 'some private key') }, :marshal => true
def after_initialize(attrs = {})
self.salt ||= Digest::SHA1.hexdigest((Time.now.to_i * rand(5)).to_s)
self.credentials ||= { :username => 'example', :password => 'test' }
end
\ No newline at end of file