Time.now -> Time.current
This commit is contained in:
@@ -41,7 +41,7 @@ class DebatesController < ApplicationController
|
||||
end
|
||||
|
||||
def mark_featured
|
||||
@debate.update_attribute(:featured_at, Time.now)
|
||||
@debate.update_attribute(:featured_at, Time.current)
|
||||
redirect_to request.query_parameters.merge(action: :index)
|
||||
end
|
||||
|
||||
@@ -55,4 +55,4 @@ class DebatesController < ApplicationController
|
||||
Debate
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,8 +8,8 @@ class Management::UsersController < Management::BaseController
|
||||
@user = User.new(user_params)
|
||||
@user.skip_password_validation = true
|
||||
@user.terms_of_service = '1'
|
||||
@user.residence_verified_at = Time.now
|
||||
@user.verified_at = Time.now
|
||||
@user.residence_verified_at = Time.current
|
||||
@user.verified_at = Time.current
|
||||
|
||||
if @user.save then
|
||||
render :show
|
||||
|
||||
@@ -38,7 +38,7 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def retire
|
||||
if valid_retired_params? && @proposal.update(retired_params.merge(retired_at: Time.now))
|
||||
if valid_retired_params? && @proposal.update(retired_params.merge(retired_at: Time.current))
|
||||
redirect_to proposal_path(@proposal), notice: t('proposals.notice.retired')
|
||||
else
|
||||
render action: :retire_form
|
||||
@@ -107,4 +107,4 @@ class ProposalsController < ApplicationController
|
||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,6 +23,6 @@ class StatsController < ApplicationController
|
||||
private
|
||||
|
||||
def daily_cache(key, &block)
|
||||
Rails.cache.fetch("public_stats/#{Time.now.strftime("%Y-%m-%d")}/#{key}", &block)
|
||||
Rails.cache.fetch("public_stats/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &block)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ class Verification::EmailController < ApplicationController
|
||||
|
||||
def show
|
||||
if Verification::Email.find(current_user, params[:email_verification_token])
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
redirect_to account_path, notice: t('verification.email.show.flash.success')
|
||||
else
|
||||
redirect_to verified_user_path, alert: t('verification.email.show.alert.failure')
|
||||
|
||||
@@ -29,7 +29,7 @@ class Verification::LetterController < ApplicationController
|
||||
def update
|
||||
@letter = Verification::Letter.new(letter_params.merge(user: current_user, verify: true))
|
||||
if @letter.valid?
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
redirect_to account_path, notice: t('verification.letter.update.flash.success')
|
||||
else
|
||||
Lock.increase_tries(@letter.user) if @letter.user
|
||||
@@ -56,4 +56,4 @@ class Verification::LetterController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,7 +31,7 @@ class Verification::SmsController < ApplicationController
|
||||
ahoy.track(:level_2_user, user_id: current_user.id) rescue nil
|
||||
|
||||
if VerifiedUser.phone?(current_user)
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
end
|
||||
|
||||
redirect_to_next_path
|
||||
@@ -69,4 +69,4 @@ class Verification::SmsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user