Sha256: 5bc8784edb216c3b25d21f5a05c4df2b1a0f108d2b5239d5fdd23a3ac51485e7

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

= auto_hash

A Ruby on Rails plugin to automate the cryptographic hashing of an
activerecord field.

UPDATE: auto_hash has quickly evolved to be a activerecord plugin that
merely wraps the excellent bcrypt-ruby
library. http://bcrypt-ruby.rubyforge.org

Works with both rails 2x and 3x

WARNING: untested with ruby 1.9.2 at the moment. (Couldn't get rails
3x to work with ruby 1.9.2 - too early I guess)

=== Synopsis

   # In Model
   class User < ActiveRecord::Base
     auto_hash :password
   end

   # Elsewhere
   user = User.create(:email => "kevin@example.com", :password => "asdf")
   user.password #=> "$2a$10$0DvrQ.HMKRySMJrn0cGEM.AcesF82tkeBfNLTZTZ.VSWePihZD3mG"
   user.password == "asdf" # => true

   # works with updating fields also
   user = User.find_by_email("kevin@example.com")
   user.password = "better_password"
   user.password == "better_password" # => true

=== Rails configuration (nothing unusual)

For rails 2x, in environment.rb
    Rails::Initializer.run do |config| do
      config.gem "auto_hash"
    end

For rails 3x, in Gemfile
   gem "auto_hash"

=== Copyright

Copyright (c) 2010 Kevin Swope. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auto_hash-0.3.1 README.rdoc
auto_hash-0.3.0 README.rdoc