Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

to_json support

  • Loading branch information...
commit a67db71a847b4462a801d4eea69548e2a72554bd 1 parent 0522bca
@spikex authored
View
2  lib/strongbox.rb
@@ -5,7 +5,7 @@
module Strongbox
- VERSION = "0.4.5"
+ VERSION = "0.4.6"
RSA_PKCS1_PADDING = OpenSSL::PKey::RSA::PKCS1_PADDING
RSA_SSLV23_PADDING = OpenSSL::PKey::RSA::SSLV23_PADDING
View
4 lib/strongbox/lock.rb
@@ -100,6 +100,10 @@ def to_s
decrypt
end
+ def to_json(options = nil)
+ to_s
+ end
+
# Needed for validations
def blank?
@instance[@name].blank?
View
6 test/strongbox_test.rb
@@ -46,6 +46,12 @@ class StrongboxTest < Test::Unit::TestCase
end
end
+ should 'impliment to_json' do
+ assert_nothing_raised do
+ @dummy.secret.to_json
+ end
+ end
+
context 'updating unencrypted fields' do
setup do
@dummy.in_the_clear = 'I see you...'
Please sign in to comment.
Something went wrong with that request. Please try again.