Releases: corgibytes/encrypted_search_attributes
Releases · corgibytes/encrypted_search_attributes
Fixes gemspec issue
v1.2.1 Fixes incorrectly specified activerecord version
Rails 4 compatability release
Weakens the restriction on ActiveRecord gem to prep for Rails 4 support.
Adds support for custom normalizations
This release adds support for custom normalization methods.
Specifying a custom normalization method
You can specify custom normalizations in a couple of different ways
Procs
You can specify a proc that gets called to perform the normalization. This works well if you only have one field that you need to override the normalization for.
class Widget < ActiveRecord::Base
attr_encrypted :name
attr_encrypted_search :name,
normalize: ->(unencrypted_value) { enencrypted_value.to_s.downcase.gsub('.', '') }
end
Symbol referencing a method
class Widget < ActiveRecord::Base
attr_encrypted :name
attr_encrypted_search :name,
normalize: :normalize_search_value
private
def normalize_search_value(unencypted_value)
enencrypted_value.to_s.downcase.gsub('.', '')
end
end
1.0.1
- Updates gemspec to mention the correct license type
1.0.0
Initial release