variable name fix and make is_tester method global for reuse in views

This commit is contained in:
Connor Turland 2017-03-09 14:36:24 -05:00
parent e544d6a6db
commit 77f76b1b5a
3 changed files with 22 additions and 21 deletions

View file

@ -41,13 +41,9 @@ class FollowService
if reason == 'created'
return user.settings.follow_map_on_created == '1'
elsif reason == 'contributed'
return user.settings.follow_map_contributed == '1'
return user.settings.follow_map_on_contributed == '1'
end
end
end
def is_tester(user)
%w(connorturland@gmail.com devin@callysto.com chessscholar@gmail.com solaureum@gmail.com ishanshapiro@gmail.com).include?(user.email)
end
end
end

View file

@ -45,6 +45,7 @@
<%= form.check_box :emails_allowed, class: 'inline' %>
Send Metamaps notifications to my email.
<% end %>
<% if is_tester(@user) %>
<%= fields_for :settings, @user.settings do |settings| %>
<%= settings.label :follow_topic_on_created, class: 'firstFieldText' do %>
<%= settings.check_box :follow_topic_on_created, class: 'inline' %>
@ -63,6 +64,7 @@
Auto-follow maps you edit.
<% end %>
<% end %>
<% end %>
</div>
<div class="changePass" onclick="Metamaps.Account.showPass()">Change Password</div>
<div class="toHide">

View file

@ -0,0 +1,3 @@
def is_tester(user)
user && %w(connorturland@gmail.com devin@callysto.com chessscholar@gmail.com solaureum@gmail.com ishanshapiro@gmail.com).include?(user.email)
end