We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a9dfc7 commit 17ff856Copy full SHA for 17ff856
lib/attr_encrypted/adapters/active_record.rb
@@ -51,7 +51,10 @@ def attr_encrypted(*attrs)
51
super
52
options = attrs.extract_options!
53
attr = attrs.pop
54
- attribute attr if ::ActiveRecord::VERSION::STRING >= "5.1.0"
+ if ::ActiveRecord::VERSION::STRING >= "5.1.0"
55
+ column_type = columns_hash[attr.to_s].type unless columns_hash[attr.to_s].nil?
56
+ column_type.nil? ? attribute(attr) : attribute(attr, column_type)
57
+ end
58
options.merge! encrypted_attributes[attr]
59
60
define_method("#{attr}_was") do
0 commit comments