sportngin/okcomputer — pull request #45 by evanlok (2014-05-16 23:48:45+00:00)
Title: Fix engine mount

Rails 4 automatically reevaluates config/routes.rb in development mode causing it to throw an error:

Invalid route name, already in use: 'okcomputer' You may have defined two routes with the same name using the \`:as\` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with \`resources\` as explained here: http://guides.rubyonrails.org/routing.html#restricting-the-routes-created

Moving the engine mount to an after_initialize block prevents #prepend from being reevaluated and adding duplicate routes.