From 9bc79fddd702f95e47ce3381257829336352f227 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 29 Nov 2013 09:26:52 +0800 Subject: [PATCH] Email confirmation for user working --- app/models/user/user.rb | 6 +++++- config/environments/development.rb | 1 + config/environments/production.rb | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 88760a32..488b67d6 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -5,7 +5,7 @@ class User include Mongoid::Tree::Ordering # use mongoid-tree because mongoid-ordering needs mongoid(~>3.0) include Mongoid::Timestamps - devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :validatable #, :timeoutable + devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :validatable, :confirmable #, :timeoutable mount_uploader :avatar, AvatarUploader @@ -295,6 +295,10 @@ class User managed_apps end end + + # def active_for_authentication? + # super && approved? + # end private diff --git a/config/environments/development.rb b/config/environments/development.rb index 987d74bb..cc80c368 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -25,6 +25,7 @@ Orbit::Application.configure do # config.cache_store = :mem_cache_store + config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.assets.debug = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 5af451f5..e2bf7f3a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -41,6 +41,7 @@ Orbit::Application.configure do # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" + config.action_mailer.default_url_options = { :host => 'http://new.tp.rulingcom.com' } # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # config.assets.precompile += %w( search.js )