Merge remote-tracking branch 'origin/master' into gs-master

This commit is contained in:
David Yip
2017-10-16 01:29:02 -05:00
60 changed files with 738 additions and 319 deletions

View File

@ -31,10 +31,12 @@ module Admin
emoji = CustomEmoji.new(domain: nil, shortcode: @custom_emoji.shortcode, image: @custom_emoji.image)
if emoji.save
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.copied_msg')
flash[:notice] = I18n.t('admin.custom_emojis.copied_msg')
else
redirect_to admin_custom_emojis_path, alert: I18n.t('admin.custom_emojis.copy_failed_msg')
flash[:alert] = I18n.t('admin.custom_emojis.copy_failed_msg')
end
redirect_to admin_custom_emojis_path(params[:page])
end
def enable

View File

@ -6,7 +6,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
before_action :check_enabled_registrations, only: [:new, :create]
before_action :configure_sign_up_params, only: [:create]
before_action :set_sessions, only: [:edit, :update]
before_action :set_instance_presenter, only: [:new, :update]
before_action :set_instance_presenter, only: [:new, :create, :update]
def destroy
not_found

View File

@ -7,12 +7,14 @@ module UserTrackingConcern
UPDATE_SIGN_IN_HOURS = 24
included do
before_action :set_user_activity, if: %i(user_signed_in? user_needs_sign_in_update?)
before_action :set_user_activity
end
private
def set_user_activity
return unless user_needs_sign_in_update?
# Mark as signed-in today
current_user.update_tracked_fields!(request)
@ -21,7 +23,7 @@ module UserTrackingConcern
end
def user_needs_sign_in_update?
current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < UPDATE_SIGN_IN_HOURS.hours.ago
user_signed_in? && (current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < UPDATE_SIGN_IN_HOURS.hours.ago)
end
def user_needs_feed_update?