1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-26 23:33:03 +00:00

fix error message when host is empty

This commit is contained in:
Adrien Waksberg 2017-01-30 20:29:42 +01:00
parent cb409b1545
commit 50aa7713f4
3 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ en:
write_data: "Can't to write the MPW file!" write_data: "Can't to write the MPW file!"
import: "Can't import, unable to read %{file}!" import: "Can't import, unable to read %{file}!"
update: update:
name_empty: "You must define a name!" host_empty: "You must define a host!"
sync: sync:
general: "An error has appeared during the sync" general: "An error has appeared during the sync"
connection: "Connection fail!" connection: "Connection fail!"

View file

@ -22,7 +22,7 @@ fr:
write_data: "Impossible d'écrire le fichier MPW!" write_data: "Impossible d'écrire le fichier MPW!"
import: "Impossible d'importer le fichier %{file}, car il n'est pas lisible!" import: "Impossible d'importer le fichier %{file}, car il n'est pas lisible!"
update: update:
name_empty: "Vous devez définir un nom!" host_empty: "Vous devez définir un host!"
sync: sync:
general: "Une erreur est survenue durant la synchronisation" general: "Une erreur est survenue durant la synchronisation"
connection: "La connexion n'a pu être établie!" connection: "La connexion n'a pu être établie!"

View file

@ -39,7 +39,7 @@ class Item
# raise an error if the hash hasn't the key name # raise an error if the hash hasn't the key name
def initialize(options={}) def initialize(options={})
if not options.has_key?(:host) or options[:host].to_s.empty? if not options.has_key?(:host) or options[:host].to_s.empty?
raise I18n.t('error.update.name_empty') raise I18n.t('error.update.host_empty')
end end
if not options.has_key?(:id) or options[:id].to_s.empty? or not options.has_key?(:created) or options[:created].to_s.empty? if not options.has_key?(:id) or options[:id].to_s.empty? or not options.has_key?(:created) or options[:created].to_s.empty?
@ -59,7 +59,7 @@ class Item
# @args: options -> a hash of parameter # @args: options -> a hash of parameter
def update(options={}) def update(options={})
if options.has_key?(:host) and options[:host].to_s.empty? if options.has_key?(:host) and options[:host].to_s.empty?
raise I18n.t('error.update.name_empty') raise I18n.t('error.update.host_empty')
end end
@group = options[:group] if options.has_key?(:group) @group = options[:group] if options.has_key?(:group)