mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-07 05:10:19 +01:00
Work in progress: has_many_polymorphs does not work with rails 3.2 because of intrusive changes in rails internals. I think we need to rip out this dependency...
This commit is contained in:
parent
a83c8b3f92
commit
86afd42148
162 changed files with 704 additions and 8724 deletions
|
|
@ -1,23 +0,0 @@
|
|||
namespace :tracks do
|
||||
desc 'Replace the password of USER with a new one.'
|
||||
task :password => :environment do
|
||||
require "highline/import"
|
||||
|
||||
user = User.find_by_login(ENV['USER'])
|
||||
if user.nil?
|
||||
puts "Sorry, we couldn't find user '#{ENV['USER']}'. To specify a different user, pass USER=username to this task."
|
||||
exit 0
|
||||
end
|
||||
|
||||
puts "Changing Tracks password for #{ENV['USER']}."
|
||||
password = ask("New password: ") { |q| q.echo = false }
|
||||
password_confirmation = ask('Retype new password: ') { |q| q.echo = false }
|
||||
|
||||
begin
|
||||
user.change_password(password, password_confirmation)
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
puts "Sorry, we couldn't change #{ENV['USER']}'s password: "
|
||||
user.errors.each_full { |msg| puts "- #{msg}\n" }
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue