From 502a8631cc40371da59ff5988a29475c5ce08793 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sun, 16 May 2021 21:09:41 +0200 Subject: [PATCH] suite --- app/controllers/admin/data_files_controller.rb | 4 ++-- app/controllers/admin/image_files_controller.rb | 4 ++-- app/controllers/public/testimonies_controller.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/data_files_controller.rb b/app/controllers/admin/data_files_controller.rb index 9852d7c..1e2b3ce 100644 --- a/app/controllers/admin/data_files_controller.rb +++ b/app/controllers/admin/data_files_controller.rb @@ -9,8 +9,8 @@ params[:file_folder_id] = params[:file_folder_id] || 1 @file_folder = FileFolder.find(params[:file_folder_id]) - @file_folders = FileFolder.all(:order => :name) - @data_files = DataFile.all(:order => "created_at DESC", :conditions => {:file_folder_id => @file_folder.id}) + @file_folders = FileFolder.order("name").all + @data_files = DataFile.order("created_at DESC").where(:file_folder_id => @file_folder.id).all @data_file = DataFile.new(:file_folder_id => @file_folder.id) if request.xhr? render :layout => false diff --git a/app/controllers/admin/image_files_controller.rb b/app/controllers/admin/image_files_controller.rb index 12da766..6cead9f 100644 --- a/app/controllers/admin/image_files_controller.rb +++ b/app/controllers/admin/image_files_controller.rb @@ -8,8 +8,8 @@ params[:album_id] = params[:album_id] || 1 @album = Album.find(params[:album_id]) - @albums = Album.all(:order => :name) - @image_files = ImageFile.all(:order => "created_at DESC", :conditions => {:album_id => @album.id}) + @albums = Album.order("name").all + @image_files = ImageFile.where(:album_id => @album.id).order("created_at DESC").all @image_file = ImageFile.new(:album_id => @album.id) if request.xhr? render :layout => false diff --git a/app/controllers/public/testimonies_controller.rb b/app/controllers/public/testimonies_controller.rb index f6a60bd..e14d342 100644 --- a/app/controllers/public/testimonies_controller.rb +++ b/app/controllers/public/testimonies_controller.rb @@ -9,7 +9,7 @@ class Public::TestimoniesController < ApplicationController if params[:slug] testimony_id = params[:slug].split('-')[0].to_i - testimony = Testimony.find(:first, :conditions => {:id => testimony_id}) + testimony = Testimony.where(:id => testimony_id).first if testimony @testimony = testimony