Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/attr_encrypted/adapters/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def attr_encrypted(*attrs)
super
options = attrs.extract_options!
attr = attrs.pop
attribute attr if ::ActiveRecord::VERSION::STRING >= "5.1.0"
if ::ActiveRecord::VERSION::STRING >= "5.1.0"
column_type = columns_hash[attr.to_s].type unless columns_hash[attr.to_s].nil?
column_type.nil? ? attribute(attr) : attribute(attr, column_type)
end
options.merge! encrypted_attributes[attr]

define_method("#{attr}_was") do
Expand Down