Skip to content

Instantly share code, notes, and snippets.

@tatey
Created November 23, 2011 08:43
Show Gist options
  • Select an option

  • Save tatey/1388207 to your computer and use it in GitHub Desktop.

Select an option

Save tatey/1388207 to your computer and use it in GitHub Desktop.
attr_accessor :cat, :dog
attr_accessor :banana, :apple
attr_encrypted :cat, :dog
attr_encrypted :banana
@coop
Copy link

coop commented Nov 23, 2011

In the same vain why couldn't you do:

attr_encrypted :car, :dog, ActiveSupport::SecureRandom.hex(64)
attr_encrypted :banana, ActiveSupport::SecureRandom.hex(64)

I don't think that would be too inconsistent considering rails 3 now allows you to do attr_accessible :attr, :as => :admin... And if I follow that then this should look like:

attr_encrypted :car, :dog, :secret => ActiveSupport::SecureRandom.hex(64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment