Rake task for confirming and approving existing users

This commit is contained in:
saurabhbhatia 2013-11-29 13:06:36 +08:00
parent f4be776697
commit 9347cd0463
4 changed files with 9 additions and 5 deletions

View File

@ -19,7 +19,6 @@ gem 'time_difference'
gem "acts_as_unvlogable"
gem 'youtube_it'
gem 'gotcha'
gem 'tlsmail'
# gem "memcached", "~> 1.4.3"
# gem "memcache-client"

View File

@ -1,4 +1,3 @@
require 'tlsmail'
Orbit::Application.configure do
# Settings specified here will take precednece over those in config/application.rb
@ -61,12 +60,12 @@ Orbit::Application.configure do
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:address => "http://smtp.gmail.com",
:port => '587',
:domain => "new.tp.rulingcom.com",

View File

@ -3,7 +3,7 @@ Orbit::Application.routes.draw do
# get "robots.txt" => 'robots#index'
devise_for :users, :controllers => { :registrations => "registrations" } do
devise_for :users, :controllers => { :registrations => "registrations", :confirmations => 'confirmations' } do
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
end

View File

@ -0,0 +1,6 @@
namespace :confirm_and_approve do
task :existing_users => :environment do
users = User.update_all({:confirmation_token => nil, :confirmed_at => Time.now, :approved => true})
puts "Users Updated"
end
end