diff options
Diffstat (limited to 'lib/authors_importer.rb')
| -rw-r--r-- | lib/authors_importer.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/authors_importer.rb b/lib/authors_importer.rb index 6195111..08b3be9 100644 --- a/lib/authors_importer.rb +++ b/lib/authors_importer.rb | |||
| @@ -8,7 +8,7 @@ class AuthorsImporter | |||
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | def import_authors | 10 | def import_authors |
| 11 | parse_csv || find_or_create_user | 11 | parse_csv |
| 12 | end | 12 | end |
| 13 | 13 | ||
| 14 | def parse_csv | 14 | def parse_csv |
| @@ -26,24 +26,10 @@ class AuthorsImporter | |||
| 26 | 26 | ||
| 27 | find_or_create_user options | 27 | find_or_create_user options |
| 28 | end | 28 | end |
| 29 | |||
| 30 | return true | ||
| 31 | end | 29 | end |
| 32 | end | 30 | end |
| 33 | 31 | ||
| 34 | def find_or_create_user options = {} | 32 | def find_or_create_user options = {} |
| 35 | password = generate_password | ||
| 36 | |||
| 37 | # default_options = { | ||
| 38 | # :login => "webmaster", | ||
| 39 | # :full_name => "Webmaster", | ||
| 40 | # :email => "webmaster@ccc.de", | ||
| 41 | # :password => password, | ||
| 42 | # :password_confirmation => password | ||
| 43 | # } | ||
| 44 | # default_options = {} | ||
| 45 | # | ||
| 46 | # options = default_options.merge(options) | ||
| 47 | puts options[:login] | 33 | puts options[:login] |
| 48 | 34 | ||
| 49 | unless User.find_by_email(options[:email]) | 35 | unless User.find_by_email(options[:email]) |
