Refactor settings

This commit is contained in:
Martin Lensment 2014-10-15 17:49:42 +03:00
parent 26f5eda636
commit dafcb6f78c
25 changed files with 132 additions and 282 deletions

View file

@ -66,11 +66,9 @@ class Dnskey < ActiveRecord::Base
hex = [domain.name_in_wire_format, flags_hex, protocol_hex, alg_hex, public_key_hex].join
bin = self.class.hex_to_bin(hex)
sg = SettingGroup.dnskeys.setting(Setting::DS_ALGORITHM).value
if sg == '1'
if Setting.ds_algorithm == 1
self.ds_digest = Digest::SHA1.hexdigest(bin).upcase
elsif sg == '2'
elsif Setting.ds_algorithm == 2
self.ds_digest = Digest::SHA256.hexdigest(bin).upcase
end
end