File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 1111#### Added
1212
1313- [ #972 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/972 ) Support ` ActiveRecord::QueryLogs `
14+ - [ #981 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/981 ) Support ` find_by ` an encrypted attribute
1415
1516Please check [ 6-1-stable] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/6-1-stable/CHANGELOG.md ) for previous changes.
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ def visit_Arel_Nodes_HomogeneousIn(o, collector)
8383 # Monkey-patch start. Add query attribute bindings rather than just values.
8484 column_name = o . column_name
8585 column_type = o . attribute . relation . type_for_attribute ( o . column_name )
86+ # Use cast_type on encrypted attributes. Don't encrypt them again
87+ column_type = column_type . cast_type if column_type . is_a? ( ActiveRecord ::Encryption ::EncryptedAttributeType )
8688 attrs = values . map { |value | ActiveRecord ::Relation ::QueryAttribute . new ( column_name , value , column_type ) }
8789
8890 collector . add_binds ( attrs , &bind_block )
You can’t perform that action at this time.
0 commit comments