[logaling-commit] logaling/logaling-command [fix-problem-when-updating-term] Check bilingual_pair_exists only if target_term != new_target_term

Back to archive index

SHIMADA Koji null+****@clear*****
Fri Sep 21 10:17:53 JST 2012


SHIMADA Koji	2012-09-21 10:17:53 +0900 (Fri, 21 Sep 2012)

  New Revision: fd3a3998a952c8ddcf5dd249ad5ef6c9d77763a5
  https://github.com/logaling/logaling-command/commit/fd3a3998a952c8ddcf5dd249ad5ef6c9d77763a5

  Log:
    Check bilingual_pair_exists only if target_term != new_target_term

  Modified files:
    lib/logaling/glossary.rb

  Modified: lib/logaling/glossary.rb (+4 -1)
===================================================================
--- lib/logaling/glossary.rb    2012-09-21 09:16:01 +0900 (dce61bc)
+++ lib/logaling/glossary.rb    2012-09-21 10:17:53 +0900 (244ad50)
@@ -59,7 +59,10 @@ module Logaling
     end
 
     def update(source_term, target_term, new_target_term, note)
-      raise Logaling::TermError if bilingual_pair_exists?(source_term, new_target_term, note)
+      if (target_term != new_target_term) && bilingual_pair_exists?(source_term, new_target_term)
+        raise Logaling::TermError
+      end
+
       glossary_source.update(source_term, target_term, new_target_term, note)
     end
 
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Back to archive index