app/models/setting.rb in automate-em-0.0.1 vs app/models/setting.rb in automate-em-0.0.2

- old
+ new

@@ -17,20 +17,20 @@ return unless self[:encrypt_setting] if self[:text_value].blank? self[:text_value] = "" else - self[:text_value] = Encryptor.decrypt(Base64.decode64(self[:text_value]), {:key => CONTROL_CONFIG[:encrypt_key], :algorithm => 'aes-256-cbc'}) + self[:text_value] = Encryptor.decrypt(Base64.decode64(self[:text_value]), {:key => Rails.application.config.automate.encrypt_key, :algorithm => 'aes-256-cbc'}) end end def do_encrypt_setting return unless self[:encrypt_setting] if self[:text_value].blank? self[:text_value] = "" else - self[:text_value] = Base64.encode64(Encryptor.encrypt(self[:text_value], {:key => CONTROL_CONFIG[:encrypt_key], :algorithm => 'aes-256-cbc'})) + self[:text_value] = Base64.encode64(Encryptor.encrypt(self[:text_value], {:key => Rails.application.config.automate.encrypt_key, :algorithm => 'aes-256-cbc'})) end end validates_presence_of :name, :object, :value_type