has_response_extentions.rb 530 B

1234567891011121314151617181920212223
  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. ActiveModel::Type::Boolean.new.cast params[:expand]
  7. end
  8. def response_full?
  9. ActiveModel::Type::Boolean.new.cast params[:full]
  10. end
  11. def response_all?
  12. ActiveModel::Type::Boolean.new.cast params[:all]
  13. end
  14. def response_only_total_count?
  15. ActiveModel::Type::Boolean.new.cast params[:only_total_count]
  16. end
  17. end