Skip to content

Commit

Permalink
Remove configuration update made by generator
Browse files Browse the repository at this point in the history
This code doesn't work. It results in a mangled initializer. We can
address this in a future release if needed, but I  think it might be
best for it to be two separate steps anyway.

Also changed the indentation in the routes template. It looks off there
but it results in nicely formatted routes when inserted.
  • Loading branch information
derekprior committed Oct 17, 2014
1 parent d88308a commit b4a8c8c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
3 changes: 1 addition & 2 deletions features/copy_routes_to_host_application.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ Feature: copy routes to host application
Scenario:
When I successfully run `bundle exec rails generate clearance:install`
And I successfully run `bundle exec rails generate clearance:routes`
Then the file "config/initializers/clearance.rb" should contain "config.routes = false"
And the file "config/routes.rb" should contain "get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'"
Then the file "config/routes.rb" should contain "get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'"
8 changes: 0 additions & 8 deletions lib/generators/clearance/routes/routes_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ module Generators
class RoutesGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)

def disable_clearance_routes_in_config
inject_into_file(
'config/initializers/clearance.rb',
' config.routes = false\n',
after: /^Clearance\.configure do |config|\n/
)
end

def inject_clearance_routes_into_application_routes
route(clearance_routes)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/clearance/routes/templates/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources :passwords, controller: 'clearance/passwords', only: [:create, :new]
resources :passwords, controller: 'clearance/passwords', only: [:create, :new]
resource :session, controller: 'clearance/sessions', only: [:create]

resources :users, controller: 'clearance/users', only: [:create] do
Expand Down

0 comments on commit b4a8c8c

Please sign in to comment.