[logaling-commit] logaling/logaling-command [add-loga-copy] Fix problem when projects with duplicate name exist

Back to archive index

SUZUKI Miho null+****@clear*****
Thu Aug 16 17:02:06 JST 2012


SUZUKI Miho	2012-08-16 17:02:06 +0900 (Thu, 16 Aug 2012)

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

  Log:
    Fix problem when projects with duplicate name exist

  Modified files:
    lib/logaling/repository.rb

  Modified: lib/logaling/repository.rb (+4 -5)
===================================================================
--- lib/logaling/repository.rb    2012-08-13 20:29:50 +0900 (1bd3068)
+++ lib/logaling/repository.rb    2012-08-16 17:02:06 +0900 (3a403cf)
@@ -161,12 +161,11 @@ module Logaling
     end
 
     def glossary_exists?(project_name, source_language, target_language)
-      project = find_project(project_name)
-      if project && project.has_glossary?(source_language, target_language)
-        true
-      else
-        false
+      project_candidates = projects.reject{|project| project.name != project_name}
+      project = project_candidates.detect do |project|
+        project.has_glossary?(source_language, target_language)
       end
+      project ? true : false
     end
   end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
다운로드 



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