Skip to content

Commit

Permalink
Ensure assemble.rb gets run even for generators
Browse files Browse the repository at this point in the history
  • Loading branch information
tslocke committed Apr 29, 2008
1 parent 4d89527 commit a804a07
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hobo/lib/hobo/model_router.rb
Expand Up @@ -51,9 +51,6 @@ def linkable?(klass, action, options={})
end

def add_routes(map)
# Don't create routes if it's a generator that's running
return if caller[-1] =~ /script[\/\\]generate:\d+$/

reset_linkables

begin
Expand All @@ -63,9 +60,13 @@ def add_routes(map)
return
end

require "#{APP_ROOT}/controllers/application" unless Object.const_defined? :ApplicationController
load "#{APP_ROOT}/assemble.rb" if File.exists? "#{APP_ROOT}/assemble.rb"

# Don't create routes if it's a generator that's running
return if caller[-1] =~ /script[\/\\]generate:\d+$/

require "#{APP_ROOT}/controllers/application" unless Object.const_defined? :ApplicationController

# Add non-subsite routes
add_routes_for(map, nil)

Expand Down

0 comments on commit a804a07

Please sign in to comment.