has_response_extentions.rb 785 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module ApplicationController::HasResponseExtentions
  3. extend ActiveSupport::Concern
  4. private
  5. def response_expand?
  6. return true if params[:expand] == true
  7. return true if params[:expand] == 'true'
  8. return true if params[:expand] == 1
  9. return true if params[:expand] == '1'
  10. false
  11. end
  12. def response_full?
  13. return true if params[:full] == true
  14. return true if params[:full] == 'true'
  15. return true if params[:full] == 1
  16. return true if params[:full] == '1'
  17. false
  18. end
  19. def response_all?
  20. return true if params[:all] == true
  21. return true if params[:all] == 'true'
  22. return true if params[:all] == 1
  23. return true if params[:all] == '1'
  24. false
  25. end
  26. end