mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +00:00
fix error message when host is empty
This commit is contained in:
parent
cb409b1545
commit
50aa7713f4
3 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ en:
|
|||
write_data: "Can't to write the MPW file!"
|
||||
import: "Can't import, unable to read %{file}!"
|
||||
update:
|
||||
name_empty: "You must define a name!"
|
||||
host_empty: "You must define a host!"
|
||||
sync:
|
||||
general: "An error has appeared during the sync"
|
||||
connection: "Connection fail!"
|
||||
|
|
|
@ -22,7 +22,7 @@ fr:
|
|||
write_data: "Impossible d'écrire le fichier MPW!"
|
||||
import: "Impossible d'importer le fichier %{file}, car il n'est pas lisible!"
|
||||
update:
|
||||
name_empty: "Vous devez définir un nom!"
|
||||
host_empty: "Vous devez définir un host!"
|
||||
sync:
|
||||
general: "Une erreur est survenue durant la synchronisation"
|
||||
connection: "La connexion n'a pu être établie!"
|
||||
|
|
|
@ -39,7 +39,7 @@ class Item
|
|||
# raise an error if the hash hasn't the key name
|
||||
def initialize(options={})
|
||||
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
|
||||
|
||||
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
|
||||
def update(options={})
|
||||
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
|
||||
|
||||
@group = options[:group] if options.has_key?(:group)
|
||||
|
|
Loading…
Reference in a new issue