Module: Redmine::Ciphering::ClassMethods

Defined in:
lib/redmine/ciphering.rb

Instance Method Summary collapse

Instance Method Details

#encrypt_all(attribute) ⇒ Object


59
60
61
62
63
64
65
66
67
# File 'lib/redmine/ciphering.rb', line 59

def encrypt_all(attribute)
  transaction do
    all.each do |object|
      clear = object.send(attribute)
      object.send "#{attribute}=", clear
      raise(ActiveRecord::Rollback) unless object.save(false)
    end
  end ? true : false
end