before_filter :authorize_web
before_filter :set_locale
before_filter { |c| c.check_database_readable(true) }
- around_filter :timeout, :except => [:start]
+ around_filter :web_timeout, :except => [:start]
def start
end
@next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] )
@prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
- @next_by_user = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] )
- @prev_by_user = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] )
+ if @changeset.user.data_public?
+ @next_by_user = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id AND user_id = :user_id", { :id => @changeset.id, :user_id => @changeset.user_id }] )
+ @prev_by_user = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id AND user_id = :user_id", { :id => @changeset.id, :user_id => @changeset.user_id }] )
+ end
rescue ActiveRecord::RecordNotFound
render :action => "not_found", :status => :not_found
end
-private
-
- def timeout
- Timeout::timeout(30) do
- yield
- end
- rescue Timeout::Error
- render :action => "timeout", :status => :request_timeout
+ def bug
+ @type = "bug"
+ @bug = MapBug.find(params[:id])
+ @next = MapBug.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @bug.id }] )
+ @prev = MapBug.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @bug.id }] )
+ rescue ActiveRecord::RecordNotFound
+ render :action => "not_found", :status => :not_found
end
end