update deprecated finder method
This commit is contained in:
parent
7da4d294d9
commit
4cb1c95793
@ -35,24 +35,20 @@ class StatusController < ApplicationController
|
|||||||
# display only 1 day by default
|
# display only 1 day by default
|
||||||
params[:days] = 1 if !params[:days]
|
params[:days] = 1 if !params[:days]
|
||||||
|
|
||||||
|
|
||||||
# set limits
|
# set limits
|
||||||
limit = (request.format == 'csv') ? 1000000 : 8000
|
limit = (request.format == 'csv') ? 1000000 : 8000
|
||||||
limit = params[:results].to_i if (params[:results] and params[:results].to_i < 8000)
|
limit = params[:results].to_i if (params[:results] and params[:results].to_i < 8000)
|
||||||
|
|
||||||
# get feed based on conditions
|
# get feed based on conditions
|
||||||
@feeds = @channel.feeds.find(
|
@feeds = @channel.feeds
|
||||||
:all,
|
.where(:created_at => get_date_range(params))
|
||||||
:conditions => { :created_at => get_date_range(params) },
|
.select([:created_at, :entry_id, :status])
|
||||||
:select => [:created_at, :entry_id, :status],
|
.order('created_at desc')
|
||||||
:order => 'created_at desc',
|
.limit(limit)
|
||||||
:limit => limit
|
|
||||||
)
|
|
||||||
|
|
||||||
# sort properly
|
# sort properly
|
||||||
@feeds.reverse!
|
@feeds.reverse!
|
||||||
|
|
||||||
|
|
||||||
# set output correctly
|
# set output correctly
|
||||||
if request.format == 'xml'
|
if request.format == 'xml'
|
||||||
@channel_output = @channel.to_xml(channel_options).sub('</channel>', '').strip
|
@channel_output = @channel.to_xml(channel_options).sub('</channel>', '').strip
|
||||||
@ -156,3 +152,4 @@ class StatusController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user