3991: Fix config checks in admin_notifier.
authorTom Clegg <tom@curoverse.com>
Thu, 25 Sep 2014 23:46:08 +0000 (19:46 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 25 Sep 2014 23:46:08 +0000 (19:46 -0400)
services/api/app/mailers/admin_notifier.rb
services/api/app/views/admin_notifier/new_inactive_user.text.erb
services/api/app/views/admin_notifier/new_user.text.erb

index 36798bebe94a2f50e4bc2d142e17f5446f152b16..5dd36c047e5cf9dacb1dd5d859372def12fe19e9 100644 (file)
@@ -2,7 +2,6 @@ class AdminNotifier < ActionMailer::Base
   include AbstractController::Callbacks
 
   default from: Rails.configuration.admin_notifier_email_from
-  before_filter :load_variables
 
   def new_user(user)
     @user = user
@@ -32,15 +31,4 @@ class AdminNotifier < ActionMailer::Base
     end
   end
 
-private
-  def load_variables
-    if Rails.configuration.respond_to?('workbench_address') and
-       not Rails.configuration.workbench_address.nil? and
-       not Rails.configuration.workbench_address.empty? then
-      @wb_address = Rails.configuration.workbench_address.sub(/\/$/,'') + '/users'
-    else
-      @wb_address = ''
-    end
-  end
-
 end
index 2e9e01d05f1363c17b75f4d037253667e3954e87..53a2b9852ed3abaabd1eff9144ab15eb3c87db12 100644 (file)
@@ -3,10 +3,10 @@ A new user landed on the inactive user page:
 
   <%= @user.full_name %> <<%= @user.email %>>
 
-<% if not @wb_address.empty? -%>
+<% if Rails.configuration.workbench_address -%>
 Please see workbench for more information:
 
-  <%= @wb_address %>
+  <%= Rails.configuration.workbench_address %>
 
 <% end -%>
 Thanks,
index 1df9fd64642c192f77cb435c3d559d799244e328..88ecbe35460ceb384527f906929cd9f626f13ecf 100644 (file)
@@ -10,10 +10,10 @@ A new user has been created<%=add_to_message%>:
 
 This user is <%= @user.is_active ? '' : 'NOT ' %>active.
 
-<% if not @wb_address.empty? -%>
+<% if Rails.configuration.workbench_address -%>
 Please see workbench for more information:
 
-  <%= @wb_address %>
+  <%= Rails.configuration.workbench_address %>
 
 <% end -%>
 Thanks,