refinery/refinerycms · error · RuntimeError

Anything added to be called before_inclusion must be callabl

Error message

Anything added to be called before_inclusion must be callable (respond to #call).

What it means

Error "Anything added to be called before_inclusion must be callable (respond to #call)." thrown in refinery/refinerycms.

Source

Thrown at core/lib/refinery/engine.rb:49

    #
    # Example:
    #   module Refinery
    #     module Images
    #       class Engine < Rails::Engine
    #         extend Refinery::Engine
    #         engine_name :images
    #
    #         before_inclusion do
    #           # perform something here
    #         end
    #       end
    #     end
    #   end
    def before_inclusion(&block)
      if block && block.respond_to?(:call)
        before_inclusion_procs << block
      else
        raise 'Anything added to be called before_inclusion must be callable (respond to #call).'
      end
    end

    private
    def after_inclusion_procs
      @@after_inclusion_procs ||= []
    end

    def before_inclusion_procs
      @@before_inclusion_procs ||= []
    end
  end
end

View on GitHub (pinned to 34438aae76)

When it happens

Trigger: Thrown at core/lib/refinery/engine.rb:49 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of refinery/refinerycms@34438aae76 (2026-08-23). Data as JSON: /api/errors/f0699b6b376f5ee3. Report an issue: GitHub.