sorting and dates fixed

This commit is contained in:
Harry Bomrah 2015-12-02 18:29:27 +08:00
parent 727ff7cfec
commit 06e866aef5
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,8 @@ class Lab
before_validation :add_http before_validation :add_http
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc") }
def get_plugin_data(fields_to_show) def get_plugin_data(fields_to_show)
plugin_datas = [] plugin_datas = []
fields_to_show.each do |field| fields_to_show.each do |field|
@ -53,7 +55,7 @@ class Lab
} }
end end
plugin_datas = datas.where(:is_hidden=>false).order_by(:year=>'desc').collect do |p| plugin_datas = datas.sort_for_frontend.collect do |p|
pd_data = [] pd_data = []
fields_to_show.collect do |t| fields_to_show.collect do |t|