split originator on indexing

This commit is contained in:
Lars Henrik Mai 2015-06-22 23:51:36 +02:00 committed by Andreas Haller
parent df8c525159
commit 25e7a580a8

View file

@ -19,6 +19,14 @@ class Paper < ActiveRecord::Base
end end
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 class << self
def import_from_json(json_string) def import_from_json(json_string)
old_count = count old_count = count