Class: ActionDispatch::Routing::RouteSet

Inherits:
Object
  • Object
show all
Defined in:
lib/cullender/engine/routes.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#finalize_with_cullender!Object

Ensure Cullender modules are included only after loading routes, because we need cullender_for mappings already declared to create filters and helpers.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cullender/engine/routes.rb', line 8

def finalize_with_cullender!
  result = finalize_without_cullender!

  @cullender_finalized ||= begin
    if Cullender.router_name.nil? && defined?(@cullender_finalized) && self != Rails.application.try(:routes)
      warn "[Cullender] We have detected that you are using cullender_for inside engine routes. " \
        "In this case, you probably want to set Cullender.router_name = MOUNT_POINT, where "   \
        "MOUNT_POINT is a symbol representing where this engine will be mounted at. For "   \
        "now Cullender will default the mount point to :main_app. You can explicitly set it"   \
        " to :main_app as well in case you want to keep the current behavior."
    end

    Cullender.regenerate_helpers!
    true
  end

  result
end