Skip to content

Releases: corgibytes/encrypted_search_attributes

Fixes gemspec issue

30 Jan 20:46
Compare
Choose a tag to compare
v1.2.1

Fixes incorrectly specified activerecord version

Rails 4 compatability release

30 Jan 20:05
Compare
Choose a tag to compare

Weakens the restriction on ActiveRecord gem to prep for Rails 4 support.

Adds support for custom normalizations

12 Jan 21:50
Compare
Choose a tag to compare

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

06 Feb 19:43
Compare
Choose a tag to compare
  • Updates gemspec to mention the correct license type

1.0.0

06 Feb 19:32
Compare
Choose a tag to compare

Initial release