mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Replace direct ES access with elasticsearch-model
This commit is contained in:
parent
5a07703166
commit
973af9f0d9
5 changed files with 18 additions and 9 deletions
|
@ -1,6 +1,10 @@
|
|||
require 'elasticsearch/model'
|
||||
require 'json'
|
||||
|
||||
class Paper < ActiveRecord::Base
|
||||
include Elasticsearch::Model
|
||||
include Elasticsearch::Model::Callbacks
|
||||
|
||||
class << self
|
||||
def import_from_json(json_string)
|
||||
JSON.parse(json_string).each do |record|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue