diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-10-01 16:31:23 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-10-01 16:31:23 -0400 |
commit | 8e40c8f68d80f05d5bcb8880b38caece4fdb3936 (patch) | |
tree | 2e2408f1d165994ebe98e4e7c1df1259c1948294 /lib/sisu/v3/db_remove.rb | |
parent | v3: header @classify: :topic_register: provide greater classification "depth" (diff) |
v3: db, book_idx field & minor re-arrangement
Diffstat (limited to 'lib/sisu/v3/db_remove.rb')
-rw-r--r-- | lib/sisu/v3/db_remove.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sisu/v3/db_remove.rb b/lib/sisu/v3/db_remove.rb index 6d481cb4..3371a9be 100644 --- a/lib/sisu/v3/db_remove.rb +++ b/lib/sisu/v3/db_remove.rb @@ -71,19 +71,21 @@ module SiSU_DbRemove : false end del_id=if driver_sqlite3 - @conn.get_first_value(%{ + remove_selected=%{ SELECT tid FROM metadata_and_text WHERE src_filename = '#{@opt.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;}).to_i + ;} + @conn.get_first_value(remove_selected).to_i else - x=@conn.select_one(%{ + remove_selected=%{ SELECT metadata_and_text.tid FROM metadata_and_text WHERE metadata_and_text.src_filename = '#{@opt.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;}) + ;} + x=@conn.select_one(remove_selected) x ? (x.join.to_i) : nil end if del_id |