SUZUKI Miho
null+****@clear*****
Thu Sep 20 14:41:09 JST 2012
SUZUKI Miho 2012-09-20 14:41:09 +0900 (Thu, 20 Sep 2012) New Revision: fa410a71a761a275d37eceff8692a49e402deffe https://github.com/logaling/logaling-server/commit/fa410a71a761a275d37eceff8692a49e402deffe Merged c5d082c: Merge pull request #13 from logaling/enable-creating-user-glossary Log: Fix to check of existing source-term and new-target-term Modified files: app/models/user_glossary.rb Modified: app/models/user_glossary.rb (+2 -2) =================================================================== --- app/models/user_glossary.rb 2012-09-20 14:40:51 +0900 (e4b0d20) +++ app/models/user_glossary.rb 2012-09-20 14:41:09 +0900 (82c0e80) @@ -33,8 +33,8 @@ class UserGlossary < ActiveRecord::Base glossary = find_glossary raise Logaling::GlossaryNotFound unless glossary - unless glossary.bilingual_pair_exists?(term.source_term, term.target_term) - raise Logaling::TermError, "term '#{term.source_term}: #{term.target_term}' doesn't exist in '#{name}'" + if glossary.bilingual_pair_exists?(term.source_term, new_term.target_term, new_term.note) + raise Logaling::TermError, "term '#{term.source_term}: #{new_term.target_term}' already exists in '#{name}'" end glossary.update(term.source_term, term.target_term, new_term.target_term, new_term.note) -------------- next part -------------- An HTML attachment was scrubbed... 다운로드