From cfd95a65aff16bf728ee2681dd765fddcafd0a3d Mon Sep 17 00:00:00 2001 From: Andy Zhao Date: Fri, 15 Jun 2018 12:52:14 -0400 Subject: [PATCH] Update "Connect Twitter acct" in settings with new callback url (#439) * Update "Connect Twitter acct" in settings with new callback url * Remove name from comments (#437) --- .../javascripts/initializers/initializeAllFollowButts.js | 2 +- .../javascripts/initializers/initializeBaseTracking.js.erb | 2 +- .../javascripts/initializers/initializeSplitTestTracking.js | 2 +- app/controllers/admin/tags_controller.rb | 2 +- app/controllers/internal/members_controller.rb | 2 +- app/controllers/tags_controller.rb | 2 +- app/labor/podcast_feed.rb | 4 ++-- app/models/article.rb | 4 ++-- app/models/comment.rb | 2 +- app/models/follow.rb | 2 +- app/services/membership_service.rb | 2 +- app/services/user_role_service.rb | 4 ++-- app/uploaders/article_image_uploader.rb | 2 +- app/uploaders/profile_image_uploader.rb | 2 +- app/views/users/_profile.html.erb | 2 +- spec/requests/stripe_subscriptions_spec.rb | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/initializers/initializeAllFollowButts.js b/app/assets/javascripts/initializers/initializeAllFollowButts.js index 312dda498..769f532d0 100644 --- a/app/assets/javascripts/initializers/initializeAllFollowButts.js +++ b/app/assets/javascripts/initializers/initializeAllFollowButts.js @@ -89,7 +89,7 @@ function handleOptimisticButtRender(butt) { } else if (butt.dataset.verb === 'login') { showModal('follow-button'); } else { - // Andy: this should handle following tags/users + // Handles actual following of tags/users assignState(butt, butt.dataset.verb); handleFollowButtPress(butt); } diff --git a/app/assets/javascripts/initializers/initializeBaseTracking.js.erb b/app/assets/javascripts/initializers/initializeBaseTracking.js.erb index 44f3d50e5..4870af48d 100644 --- a/app/assets/javascripts/initializers/initializeBaseTracking.js.erb +++ b/app/assets/javascripts/initializers/initializeBaseTracking.js.erb @@ -65,7 +65,7 @@ function fbTrack() { function facebookTrackingScript() { if (typeof fbq === 'undefined') { - // Andy: also don't lint this minified function + // Also don't lint this minified function !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; diff --git a/app/assets/javascripts/initializers/initializeSplitTestTracking.js b/app/assets/javascripts/initializers/initializeSplitTestTracking.js index 71a2e75b9..ffe61764e 100644 --- a/app/assets/javascripts/initializers/initializeSplitTestTracking.js +++ b/app/assets/javascripts/initializers/initializeSplitTestTracking.js @@ -29,7 +29,7 @@ function trackOutboundLink(url, versionString) { 'hitCallback': function () { document.location = url; } }); } else { - // Andy: send without tracking any of user's information + // Direct properly without tracking any of user's information window.location = url; } } diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb index 9fe795169..a862b1a77 100644 --- a/app/controllers/admin/tags_controller.rb +++ b/app/controllers/admin/tags_controller.rb @@ -13,7 +13,7 @@ module Admin private def convert_empty_string_to_nil - # Andy: nil plays nicely with our hex colors, whereas empty string doesn't + # nil plays nicely with our hex colors, whereas empty string doesn't params[:tag][:text_color_hex] = nil if params[:tag][:text_color_hex] == "" params[:tag][:bg_color_hex] = nil if params[:tag][:bg_color_hex] == "" end diff --git a/app/controllers/internal/members_controller.rb b/app/controllers/internal/members_controller.rb index 4a15839ab..c6f6e1394 100644 --- a/app/controllers/internal/members_controller.rb +++ b/app/controllers/internal/members_controller.rb @@ -2,7 +2,7 @@ class Internal::MembersController < Internal::ApplicationController layout "internal" def index - # Andy: with_role and with_any_role returns an array and not an ActiveRecord collection + # with_role and with_any_role return an array and not an ActiveRecord collection @users = case params[:state] when "by-scholars" User.with_role(:workshop_pass).sort_by(&:name) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 025f0fa92..feedc6a24 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -32,7 +32,7 @@ class TagsController < ApplicationController end def convert_empty_string_to_nil - # Andy: nil plays nicely with our hex colors, whereas empty string doesn't + # nil plays nicely with our hex colors, whereas empty string doesn't params[:tag][:text_color_hex] = nil if params[:tag][:text_color_hex] == "" params[:tag][:bg_color_hex] = nil if params[:tag][:bg_color_hex] == "" end diff --git a/app/labor/podcast_feed.rb b/app/labor/podcast_feed.rb index 122d45972..bdc491ed5 100644 --- a/app/labor/podcast_feed.rb +++ b/app/labor/podcast_feed.rb @@ -56,7 +56,7 @@ class PodcastFeed end def existing_episode(item, podcast) - # Andy: presence returns nil if the query is an empty array, otherwise returns the array + # presence returns nil if the query is an empty array, otherwise returns the array PodcastEpisode.where(media_url: item.enclosure.url).presence || PodcastEpisode.where(title: item.title).presence || PodcastEpisode.where(guid: item.guid.to_s).presence || @@ -71,7 +71,7 @@ class PodcastFeed item.enclosure.url end rescue - # Andy: podcast episode must have a media_url + # podcast episode must have a media_url ep.media_url = item.enclosure.url if podcast.status_notice.empty? podcast.update(status_notice: "This podcast may not be playable in the browser") diff --git a/app/models/article.rb b/app/models/article.rb index 335985503..307d53bfd 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -45,7 +45,7 @@ class Article < ApplicationRecord after_save :update_main_image_background_hex after_save :detect_human_language # after_save :send_to_moderator - # Andy: turned off for now + # turned off for now before_destroy :before_destroy_actions serialize :ids_for_suggested_articles @@ -344,7 +344,7 @@ class Article < ApplicationRecord # def send_to_moderator # ModerationService.new.send_moderation_notification(self) if published - # Andy: turned off for now + # turned off for now # end def before_destroy_actions diff --git a/app/models/comment.rb b/app/models/comment.rb index 2d0c57434..85923dae6 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -193,7 +193,7 @@ class Comment < ApplicationRecord nil end - # Andy: Administrate field + # Administrate field def name_of_user user.name end diff --git a/app/models/follow.rb b/app/models/follow.rb index b0e4944a6..dbda56451 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -17,7 +17,7 @@ class Follow < ApplicationRecord "following_orgs_count" when "ActsAsTaggableOn::Tag" "following_tags_count" - # Andy: Add more whens if we add more follow types + # add more whens if we add more follow types end }, column_names: { ["follows.followable_type = ?", "User"] => "following_users_count", diff --git a/app/services/membership_service.rb b/app/services/membership_service.rb index bb57a4d83..b6358350c 100644 --- a/app/services/membership_service.rb +++ b/app/services/membership_service.rb @@ -55,7 +55,7 @@ class MembershipService def find_or_create_plan Stripe::Plan.retrieve("membership-#{monthly_dues}") - # Andy: using rescue because not finding a plan errors out instead returning of nil + # Using rescue because not finding a plan errors out instead returning of nil rescue Stripe::InvalidRequestError Stripe::Plan.create( id: "membership-#{monthly_dues}", diff --git a/app/services/user_role_service.rb b/app/services/user_role_service.rb index 0270ba4ef..ffe668d45 100644 --- a/app/services/user_role_service.rb +++ b/app/services/user_role_service.rb @@ -20,7 +20,7 @@ class UserRoleService tag.errors[:moderator_ids] << ": user id #{id} was not found" end return false if !tag.errors[:moderator_ids].blank? - # Andy: Don't have to worry about comparing old and new values. + # Don't have to worry about comparing old and new values. tag.tag_moderator_ids.each do |id| User.find(id).remove_role(:tag_moderator, tag) end @@ -88,7 +88,7 @@ class UserRoleService @user.remove_role :banned end - # Andy: Only give warning method b/c no need to remove warnings + # Only give warning method b/c no need to remove warnings def give_warning(content) @user.add_role :warned create_or_update_note("warned", content) diff --git a/app/uploaders/article_image_uploader.rb b/app/uploaders/article_image_uploader.rb index 20125fbd9..aa1daf8c5 100644 --- a/app/uploaders/article_image_uploader.rb +++ b/app/uploaders/article_image_uploader.rb @@ -1,6 +1,6 @@ class ArticleImageUploader < CarrierWave::Uploader::Base include CarrierWave::BombShelter - # Andy: adds resolution size to images of 4096x4096 + # Adds resolution size limit to images of 4096x4096 def store_dir "i/" diff --git a/app/uploaders/profile_image_uploader.rb b/app/uploaders/profile_image_uploader.rb index 371b25c1f..a0bd0f6e4 100644 --- a/app/uploaders/profile_image_uploader.rb +++ b/app/uploaders/profile_image_uploader.rb @@ -1,6 +1,6 @@ class ProfileImageUploader < CarrierWave::Uploader::Base include CarrierWave::BombShelter - # Andy: adds resolution size to images of 4096x4096 + # Adds resolution size limit to images of 4096x4096 def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" diff --git a/app/views/users/_profile.html.erb b/app/views/users/_profile.html.erb index 35e0e4be7..d32946eee 100644 --- a/app/views/users/_profile.html.erb +++ b/app/views/users/_profile.html.erb @@ -12,7 +12,7 @@ <% if @user.identities.where(provider:'twitter').empty? %>
- + <%= ENV["APP_DOMAIN"] %>/users/auth/twitter/callback" class="big-button cta" data-no-instant> CONNECT TWITTER ACCOUNT
diff --git a/spec/requests/stripe_subscriptions_spec.rb b/spec/requests/stripe_subscriptions_spec.rb index 8cba15427..15fd8b95d 100644 --- a/spec/requests/stripe_subscriptions_spec.rb +++ b/spec/requests/stripe_subscriptions_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "StripeSubscriptions", type: :request do describe "POST StripeSubscriptions#create" do context "when a valid request is made" do - # Andy: Amount is a string here because Stripe returns a string when form is submitted + # Amount is a string here because Stripe returns a string when form is submitted before do post "/stripe_subscriptions", params: { amount: "12",