mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
refactor list_controller
- minor refactoring of actions 'category' and 'category_feed' - fix defect in 'category' where check was for literal string 'uncategorized' instead of SiteSetting.uncategorized_name - major refactoring on defined topic actions
This commit is contained in:
@ -284,10 +284,18 @@ class ApplicationController < ActionController::Base
|
||||
render status: status, layout: 'no_js', formats: [:html], template: '/exceptions/not_found'
|
||||
end
|
||||
|
||||
protected
|
||||
protected
|
||||
|
||||
def api_key_valid?
|
||||
request["api_key"] && SiteSetting.api_key_valid?(request["api_key"])
|
||||
end
|
||||
|
||||
# returns an array of integers given a param key
|
||||
# returns nil if key is not found
|
||||
def param_to_integer_list(key, delimiter = ',')
|
||||
if params[key]
|
||||
params[key].split(delimiter).map(&:to_i)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user