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' if reason == 'created'
return user.settings.follow_map_on_created == '1' return user.settings.follow_map_on_created == '1'
elsif reason == 'contributed' elsif reason == 'contributed'
return user.settings.follow_map_contributed == '1' return user.settings.follow_map_on_contributed == '1'
end end
end 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
end end

View file

@ -45,22 +45,24 @@
<%= form.check_box :emails_allowed, class: 'inline' %> <%= form.check_box :emails_allowed, class: 'inline' %>
Send Metamaps notifications to my email. Send Metamaps notifications to my email.
<% end %> <% end %>
<%= fields_for :settings, @user.settings do |settings| %> <% if is_tester(@user) %>
<%= settings.label :follow_topic_on_created, class: 'firstFieldText' do %> <%= fields_for :settings, @user.settings do |settings| %>
<%= settings.check_box :follow_topic_on_created, class: 'inline' %> <%= settings.label :follow_topic_on_created, class: 'firstFieldText' do %>
Auto-follow topics you create. <%= settings.check_box :follow_topic_on_created, class: 'inline' %>
<% end %> Auto-follow topics you create.
<%= settings.label :follow_topic_on_contributed, class: 'firstFieldText' do %> <% end %>
<%= settings.check_box :follow_topic_on_contributed, class: 'inline' %> <%= settings.label :follow_topic_on_contributed, class: 'firstFieldText' do %>
Auto-follow topics you edit. <%= settings.check_box :follow_topic_on_contributed, class: 'inline' %>
<% end %> Auto-follow topics you edit.
<%= settings.label :follow_map_on_created, class: 'firstFieldText' do %> <% end %>
<%= settings.check_box :follow_map_on_created, class: 'inline' %> <%= settings.label :follow_map_on_created, class: 'firstFieldText' do %>
Auto-follow maps you create. <%= settings.check_box :follow_map_on_created, class: 'inline' %>
<% end %> Auto-follow maps you create.
<%= settings.label :follow_map_on_contributed, class: 'firstFieldText' do %> <% end %>
<%= settings.check_box :follow_map_on_contributed, class: 'inline' %> <%= settings.label :follow_map_on_contributed, class: 'firstFieldText' do %>
Auto-follow maps you edit. <%= settings.check_box :follow_map_on_contributed, class: 'inline' %>
Auto-follow maps you edit.
<% end %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>

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