Make PaperSearch persistent

This commit is contained in:
Lars Henrik Mai 2015-10-10 09:48:18 +02:00
parent 82c2e7e6b8
commit fce65636f7
3 changed files with 23 additions and 12 deletions

View file

@ -1,12 +1,8 @@
class PaperSearch
class PaperSearch < ActiveRecord::Base
include ActiveModel::Model
attr_accessor :query, :paper_type, :originator, :sort_by
def to_hash
options = {paper_type: @paper_type, originator: @originator, sort_by: @sort_by}
PaperSearch.definition(@query, options)
def to_definition
options = {paper_type: paper_type, originator: originator, sort_by: sort_by}
PaperSearch.definition(query, options)
end
def self.definition(q, options={})