Mercurial > zeropaste
changeset 377:4e6afc8140fb
Use Time.zone as per rubocop recommendation.
author | nanaya <me@myconan.net> |
---|---|
date | Sat, 06 Jun 2015 22:35:21 +0900 |
parents | 02903dc8214d |
children | e84276bf344a |
files | app/models/paste.rb |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/app/models/paste.rb Sat Jun 06 22:34:36 2015 +0900 +++ b/app/models/paste.rb Sat Jun 06 22:35:21 2015 +0900 @@ -79,7 +79,7 @@ end def paste_limit - ip_post_recent_count = self.class.where(:ip => ip).where("created_at > ?", Time.now - 1.hour).count + ip_post_recent_count = self.class.where(:ip => ip).where("created_at > ?", Time.zone.now - 1.hour).count errors.add :base, :limit if ip_post_recent_count > 100 end