<commit_before>defmodule ExAdmin.ResourceController do
  @moduledoc false

  defmacro __using__(_opts) do
    quote do
      alias ExAdmin.Authorization
      import ExAdmin.Utils
      import ExAdmin.ParamsToAtoms

      def action(%{private: %{phoenix_action: action}} = conn, _options) do
        conn = conn |> assign(:xhr, get_req_header(conn, "x-requested-with") == ["XMLHttpRequest"])
        resource = @resource || conn.params["resource"]
        conn = scrub_params(conn, resource, action)
        defn = get_registered_by_controller_route!(conn, resource)
        params = filter_params(conn.params, defn.resource_model)

        if !restricted_action?(action, defn) do
          conn
          |> assign(:defn, defn)
          |> load_resource(action, defn, params[:id])<commit_msg>Fix resource_controller macro compiler warning<commit_after>defmodule ExAdmin.ResourceController do
  @moduledoc false

  defmacro __using__(_opts) do
    quote do
      alias ExAdmin.Authorization
      import ExAdmin.Utils
      import ExAdmin.ParamsToAtoms

      def action(%{private: %{phoenix_action: action}} = conn, _options) do
        conn = conn |> assign(:xhr, get_req_header(conn, "x-requested-with") == ["XMLHttpRequest"])
        resource = Macro.expand(@resource, __ENV__) || conn.params["resource"]
        conn = scrub_params(conn, resource, action)
        defn = get_registered_by_controller_route!(conn, resource)
        params = filter_params(conn.params, defn.resource_model)

        if !restricted_action?(action, defn) do
          conn
          |> assign(:defn, defn)
          |> load_resource(action, defn, params[:id])
{'fraction_non_alphanumeric': 0.10827250608272507, 'fraction_numerical': 0.0, 'mean_word_length': 3.3866666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4023495', 'n_tokens_mistral': 493, 'n_tokens_neox': 476, 'n_words': 108}