Sha256: 5dff48e390624c379f81ac9fc5449315a7b57c9245fd771e009437cd88ae0bc2
Contents?: true
Size: 581 Bytes
Versions: 25
Compression:
Stored size: 581 Bytes
Contents
module Clinical class Collection < WillPaginate::Collection include HappyMapper attr_accessor :count class << self def create_from_results(page, per_page, body) results = SearchResult.parse(body) col = create(page, per_page, results.count || 0) do |pager| pager.replace(results.trials) end col.count = results.count col end end class SearchResult include HappyMapper tag "search_results" attribute "count", Integer has_many :trials, Clinical::Trial end end end
Version data entries
25 entries across 25 versions & 2 rubygems