Adds two more before filters.

Again, this is for permissions and we need to cut off the api prefix in
every api/v? controller.
pull/1196/head
Martin Czuchra 12 years ago
parent b44d62830e
commit 21657a1e39
  1. 16
      app/controllers/api/v2/api_controller.rb

@ -43,6 +43,14 @@ module Api
result
end
def apply_at_timestamp(*args, &block)
original_controller = params[:controller]
params[:controller] = original_controller.gsub(api_version, "")
result = super(*args, &block)
params[:controller] = original_controller
result
end
def jump_to_project_menu_item(*args, &block)
original_controller = params[:controller]
params[:controller] = original_controller.gsub(api_version, "")
@ -59,6 +67,14 @@ module Api
result
end
def find_all_projects_by_project_id(*args, &block)
original_controller = params[:controller]
params[:controller] = original_controller.gsub(api_version, "")
result = super(*args, &block)
params[:controller] = original_controller
result
end
def find_project_by_project_id(*args, &block)
original_controller = params[:controller]
params[:controller] = original_controller.gsub(api_version, "")

Loading…
Cancel
Save