update deprecated finder method
This commit is contained in:
parent
7da4d294d9
commit
4cb1c95793
@ -18,7 +18,7 @@ class StatusController < ApplicationController
|
|||||||
format.html { render :text => 'Sorry the statuses are not public' }
|
format.html { render :text => 'Sorry the statuses are not public' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -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
|
||||||
@ -150,9 +146,10 @@ class StatusController < ApplicationController
|
|||||||
only += [:latitude] unless channel.latitude.nil?
|
only += [:latitude] unless channel.latitude.nil?
|
||||||
only += [:longitude] unless channel.longitude.nil?
|
only += [:longitude] unless channel.longitude.nil?
|
||||||
only += [:elevation] unless channel.elevation.nil? or channel.elevation.empty?
|
only += [:elevation] unless channel.elevation.nil? or channel.elevation.empty?
|
||||||
|
|
||||||
return only
|
return only
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user