Sha256: c10522c6d2e1106b8f0d8dcb9c7ba3ce91c038a076d246dd9b18306d8355c036

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

# EncryptedSearchAttributes

Auto populates encrypted fields that are designed for searching

Encrypting a field makes it very difficult to perform a case insensitive search for the columns data. This gem normalizes the text before encrypted it and storing it in a search column. The current normalization method is to convert the text to all lowercase.

This gem is intended to be used with the symmetric-encryption gem. It assumes that a `encrypted_search_attribute` column exists for the encrypted attribute.

## Example

Let's assume we have the following ActiveRecord model defined.

```ruby
class Widget < ActiveRecord::Base
  attr_encrypted        :name
  attr_encrypted_search :name
end
```

This would require the database schema to look something like this.

```ruby
  create_table "patients", :force => true do |t|
    t.string "encrypted_name"
    t.string "encrypted_search_name"
  end
```

## Installation

Add this line to your application's Gemfile:

    gem 'encrypted_search_attributes'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install encrypted_search_attributes

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( http://github.com/mscottford/encrypted_search_attributes/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
encrypted_search_attributes-1.0.1 README.md