Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LegacySystem.pdf

k-motoyan-diverse
November 27, 2018
3.9k

 LegacySystem.pdf

k-motoyan-diverse

November 27, 2018
Tweet

Transcript

  1. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  2. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end これは かくうの ソースコードです
  3. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  4. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  5. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  6. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  7. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  8. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end
  9. class UserController < ApplicationController def index @user = User.find_by!(id: params[:id],

    status: :active) if [email protected]_debug_user? AccessLog.create user_id: @user.id, user_name: @user.name, access_page: "user_index" end begin @user.friends.each do |friend| if !friend.enabled_friend_access_notification @notification = Notification.create user_id: @friend.id friend_id: @user.id message: "#{@user.name}͕ϚΠϖʔδʹΞΫηε͠·ͨ͠" end PushService.send(@notification) end rescue => e @error = ErrorLog.create message: "ϑϨϯυͷ௨஌ʹࣦഊ͠·ͨ͠" redirect_to error_page_path(@error) end case @user.score when 0..10 render :score1_user when 11..30 render :score2_user when 31..50 render :score3_user when 51..70 render :score4_user when 81..100 render :score5_user end end end 71 から 80 のケースがない!?