[Groonga-commit] ranguba/epub-searcher at e66dae9 [master] Add utility method to delete record to controller

Back to archive index

KITAITI Makoto null+****@clear*****
Fri Dec 26 13:32:22 JST 2014


KITAITI Makoto	2014-12-26 13:32:22 +0900 (Fri, 26 Dec 2014)

  New Revision: e66dae97dda05a05910141e44ec87747f9c294d8
  https://github.com/ranguba/epub-searcher/commit/e66dae97dda05a05910141e44ec87747f9c294d8

  Message:
    Add utility method to delete record to controller

  Modified files:
    app/app.rb

  Modified: app/app.rb (+18 -0)
===================================================================
--- app/app.rb    2014-12-26 13:31:44 +0900 (efaa243)
+++ app/app.rb    2014-12-26 13:32:22 +0900 (5975c75)
@@ -93,6 +93,24 @@ module EPUBSearcher
         db.close
       end
     end
+
+    def delete_from_groonga(id)
+      db_options = {
+        protocol: :http,
+        host: settings.droonga_host,
+        port: settings.droonga_port
+      }
+      db = RemoteDatabase.new(db_options)
+      begin
+        params = {
+          :table => :Books,
+          :id => id
+        }
+        db.delete(params)
+      ensure
+        db.close
+      end
+    end
   end
 
 end
-------------- next part --------------
HTML����������������������������...
다운로드 



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