app/controllers/exception_track/logs_controller.rb in exception-track-0.6.2 vs app/controllers/exception_track/logs_controller.rb in exception-track-1.0.0
- old
+ new
@@ -10,11 +10,11 @@
@logs = Log.order("id desc").page(params[:page]).per(15)
end
def export
@logs = Log.order("id desc").where("created_at >= ?", 3.months.ago)
- send_data JSON.pretty_generate(@logs.as_json(only: [:title, :body, :created_at, :updated_at])), filename: "#{Date.current}.json", disposition: "attachment"
+ send_data JSON.pretty_generate(@logs.as_json(only: %i[title body created_at updated_at])), filename: "#{Date.current}.json", disposition: "attachment"
end
# GET /exception_logs/1
def show; end
@@ -23,10 +23,9 @@
Log.delete_all
redirect_to logs_url, notice: "Logs was successfully destroyed."
end
private
-
# Use callbacks to share common setup or constraints between actions.
def set_log
@log = Log.find(params[:id])
end
end