Merge branch 'master' into redux-polling

This commit is contained in:
Juanjo Bazán
2016-12-27 18:22:06 +01:00
235 changed files with 3445 additions and 1099 deletions

View File

@@ -5,7 +5,7 @@ module ActsAsParanoidAliases
def hide
return false if hidden?
update_attribute(:hidden_at, Time.now)
update_attribute(:hidden_at, Time.current)
after_hide
end
@@ -21,7 +21,7 @@ module ActsAsParanoidAliases
end
def confirm_hide
update_attribute(:confirmed_hide_at, Time.now)
update_attribute(:confirmed_hide_at, Time.current)
end
def restore(opts={})

View File

@@ -21,7 +21,7 @@ class EmailDigest
end
def mark_as_emailed
notifications.update_all(emailed_at: Time.now)
notifications.update_all(emailed_at: Time.current)
end
end
end

View File

@@ -11,7 +11,7 @@ module ScoreCalculator
score = ups - downs
offset = Math.log([score.abs, 1].max, 10) * (ups / [total, 1].max)
sign = score <=> 0
seconds = ((date || Time.now) - EPOC).to_f
seconds = ((date || Time.current) - EPOC).to_f
(((offset * sign) + (seconds/TIME_UNIT)) * 10000000).round
end

View File

@@ -13,4 +13,4 @@ namespace :comments do
end
end
end
end

View File

@@ -1,4 +1,5 @@
namespace :proposals do
desc "Updates all proposals by recalculating their hot_score"
task touch: :environment do
Proposal.find_in_batches do |proposals|
@@ -6,4 +7,4 @@ namespace :proposals do
end
end
end
end

View File

@@ -1,4 +1,5 @@
namespace :spending_proposals do
desc "Sends an email to the authors of unfeasible spending proposals"
task send_unfeasible_emails: :environment do
SpendingProposal.find_each do |spending_proposal|
@@ -18,4 +19,4 @@ namespace :spending_proposals do
end
end
end
end

View File

@@ -82,6 +82,6 @@ namespace :users do
User.all.each do |user|
user.update(password_changed_at: user.created_at)
end
end
end
end
end