lib/lockbox.rb in lockbox-0.3.0 vs lib/lockbox.rb in lockbox-0.3.1
- old
+ new
@@ -18,14 +18,17 @@
require "lockbox/railtie" if defined?(Rails)
if defined?(ActiveSupport)
ActiveSupport.on_load(:active_record) do
extend Lockbox::Model
+ extend Lockbox::Model::Attached
end
ActiveSupport.on_load(:mongoid) do
Mongoid::Document::ClassMethods.include(Lockbox::Model)
+ # TODO remove in 0.4.0
+ Mongoid::Document::ClassMethods.include(Lockbox::Model::Attached)
end
end
module Lockbox
class Error < StandardError; end
@@ -77,10 +80,9 @@
def self.to_hex(str)
str.unpack("H*").first
end
- # legacy
def self.new(**options)
Encryptor.new(**options)
end
end