From d0d96f7168fe334d2c2405f6d3375fbdfff3d293 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 13 Apr 2016 15:30:32 +0800 Subject: [PATCH] sorting changed and added target for profile page --- app/models/patent.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/patent.rb b/app/models/patent.rb index 02b71fa..db7a9a5 100644 --- a/app/models/patent.rb +++ b/app/models/patent.rb @@ -34,7 +34,7 @@ class Patent before_validation :add_http - scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc") } + scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc", :application_date => "desc") } def get_plugin_data(fields_to_show) plugin_datas = [] @@ -88,7 +88,7 @@ class Patent fields_to_show.collect do |t| case t when "patent_title" - pd_data << {"data_title" => "" + (p.send(t) rescue "") + ""} + pd_data << {"data_title" => "" + (p.send(t) rescue "") + ""} when "publish_date" pd_data << {"data_title" => (p.publish_date.strftime("%Y/%m/%d") rescue "")} when "application_date"