forked from saurabh/personal-lab
sorting and dates fixed
This commit is contained in:
parent
727ff7cfec
commit
06e866aef5
|
@ -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|
|
||||||
|
|
Loading…
Reference in New Issue