Skip to content

Commit

Permalink
Fix the indent of the to_s method injected into User by the model gen…
Browse files Browse the repository at this point in the history
…erator
  • Loading branch information
jcoyne committed Apr 11, 2014
1 parent 8ed1ba7 commit 33d1010
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/generators/blacklight/models_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ def generate_devise_assets
generate "devise_guests", model_name.classify

# add the #to_s to the model.
insert_into_file("app/models/#{model_name}.rb", :before => /end(\n| )*$/) do
%{
# Method added by Blacklight; Blacklight uses #to_s on your
# user class to get a user-displayable login/identifier for
# the account.
def to_s
email
end
}
insert_into_file("app/models/#{model_name}.rb", before: /end(\n| )*$/) do
"\n # Method added by Blacklight; Blacklight uses #to_s on your\n" +
" # user class to get a user-displayable login/identifier for\n" +
" # the account.\n" +
" def to_s\n" +
" email\n" +
" end\n"
end
gsub_file("config/initializers/devise.rb", "config.sign_out_via = :delete", "config.sign_out_via = :get")
end
Expand Down

0 comments on commit 33d1010

Please sign in to comment.