class Dunlop::UserFiltersController < Dunlop::ApplicationController
  include Dunlop::Ember::ApiBaseController # Ugly to require a non dependency here, but for now only used in application explicitly including dunlop-ember
  before_action :check_current_user

  private

  def serialize_options
    {key_transform: :unaltered}
  end

  def permitted_params
    [:name, :description, :scope_key, :is_default, filters: {}] # user is ALWAYS current_user (until it is not :O)
  end

  def check_current_user
    head 404 unless current_user.present?
  end

  def record_scope
    current_user.user_filters
  end

  def index_pagination?
    false
  end

end
