mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Make PaperSearch persistent
This commit is contained in:
parent
82c2e7e6b8
commit
fce65636f7
3 changed files with 23 additions and 12 deletions
|
@ -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={})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue