mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 15:43:14 +01:00
split originator on indexing
This commit is contained in:
parent
df8c525159
commit
25e7a580a8
1 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,14 @@ class Paper < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def split_originator
|
||||
originator.split(/\d\.\s/).reject {|s| s.blank?} || originator
|
||||
end
|
||||
|
||||
def as_indexed_json(options={})
|
||||
as_json.merge(originator: split_originator)
|
||||
end
|
||||
|
||||
class << self
|
||||
def import_from_json(json_string)
|
||||
old_count = count
|
||||
|
|
Loading…
Reference in a new issue