This commit is contained in:
Nicolas Bally 2021-05-16 21:11:57 +02:00
parent dd48be3007
commit 4c5f32ac28
5 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -3,6 +3,6 @@
#block_portlet.block_portlets{:id => block.id, :"data-block_id"=>block.id, :class => ("block_portlets_sortable" if sortable).to_s}
=render :partial => "portlet/portlets/portlet", :collection => block.portlets.find(:all, :order => :position, :include => :content)
=render :partial => "portlet/portlets/portlet", :collection => block.portlets.order(:position).includes(:content).all

View File

@ -2,5 +2,5 @@
=form.semantic_fields_for :menu_content do |content|
= content.inputs do
-MenuItem.find(:all, :conditions => {:parent_id => nil}, :order => :position).each do |m|
-MenuItem.where(:parent_id => nil).order(:position).all.each do |m|
=render :partial => "form_line", :locals => {:menu_item => m, :f => content}