activemodel (= 7.1.3.3)
activesupport (= 7.1.3.3)
timeout (>= 0.4.0)
- activerecord-import (1.6.0)
+ activerecord-import (1.7.0)
activerecord (>= 4.2)
activestorage (7.1.3.3)
actionpack (= 7.1.3.3)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
aws-eventstream (1.3.0)
- aws-partitions (1.928.0)
- aws-sdk-core (3.196.0)
+ aws-partitions (1.931.0)
+ aws-sdk-core (3.196.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
aws-sdk-kms (1.81.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
- aws-sdk-s3 (1.150.0)
+ aws-sdk-s3 (1.151.0)
aws-sdk-core (~> 3, >= 3.194.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
puma (5.6.8)
nio4r (~> 2.0)
quad_tile (1.0.1)
- racc (1.7.3)
+ racc (1.8.0)
rack (2.2.9)
rack-cors (2.0.2)
rack (>= 2.0.0)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
- rb-inotify (0.10.1)
+ rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.6.3.1)
psych (>= 4.0.0)
- regexp_parser (2.9.1)
+ regexp_parser (2.9.2)
reline (0.5.7)
io-console (~> 0.5)
request_store (1.7.0)
rubocop-performance (1.21.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
- rubocop-rails (2.24.1)
+ rubocop-rails (2.25.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
secure_headers (6.5.0)
- selenium-webdriver (4.20.1)
+ selenium-webdriver (4.21.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
##
# Check if the current user has exceed the rate limit for comments
def rate_limit_exceeded?
- recent_comments = current_user.changeset_comments.where("created_at >= ?", Time.now.utc - 1.hour).count
+ recent_comments = current_user.changeset_comments.where(:created_at => Time.now.utc - 1.hour..).count
recent_comments >= current_user.max_changeset_comments_per_hour
end
changesets.where("closed_at >= ? and created_at <= ?", from, to)
else
# if there is no comma, assume its a lower limit on time
- changesets.where("closed_at >= ?", Time.parse(time).utc)
+ changesets.where(:closed_at => Time.parse(time).utc..)
end
# stupid Time seems to throw both of these for bad parsing, so
# we have to catch both and ensure the correct code path is taken.
changesets = changesets.where(:user => current_user.nearby)
end
- changesets = changesets.where("changesets.id <= ?", @params[:max_id]) if @params[:max_id]
+ changesets = changesets.where(:changesets => { :id => ..@params[:max_id] }) if @params[:max_id]
@changesets = changesets.order("changesets.id DESC").limit(20).preload(:user, :changeset_tags, :comments)
if @changeset.user.active? && @changeset.user.data_public?
changesets = conditions_nonempty(@changeset.user.changesets)
@next_by_user = changesets.where("id > ?", @changeset.id).reorder(:id => :asc).first
- @prev_by_user = changesets.where("id < ?", @changeset.id).reorder(:id => :desc).first
+ @prev_by_user = changesets.where(:id => ...@changeset.id).reorder(:id => :desc).first
end
render :layout => map_layout
rescue ActiveRecord::RecordNotFound
friendship.befriendee = @friend
if current_user.friends_with?(@friend)
flash[:warning] = t ".already_a_friend", :name => @friend.display_name
- elsif current_user.friendships.where("created_at >= ?", Time.now.utc - 1.hour).count >= current_user.max_friends_per_hour
+ elsif current_user.friendships.where(:created_at => Time.now.utc - 1.hour..).count >= current_user.max_friends_per_hour
flash.now[:error] = t ".limit_exceeded"
elsif friendship.save
flash[:notice] = t ".success", :name => @friend.display_name
@message.sender = current_user
@message.sent_on = Time.now.utc
- if current_user.sent_messages.where("sent_on >= ?", Time.now.utc - 1.hour).count >= current_user.max_messages_per_hour
+ if current_user.sent_messages.where(:sent_on => Time.now.utc - 1.hour..).count >= current_user.max_messages_per_hour
flash.now[:error] = t ".limit_exceeded"
render :action => "new"
elsif @message.save
scope :visible_to, ->(user) { where(:assigned_role => user.roles.map(&:role)) }
def read_reports
- resolved_at.present? ? reports.where("updated_at < ?", resolved_at) : nil
+ resolved_at.present? ? reports.where(:updated_at => ...resolved_at) : nil
end
def unread_reports
- resolved_at.present? ? reports.where("updated_at >= ?", resolved_at) : reports
+ resolved_at.present? ? reports.where(:updated_at => resolved_at..) : reports
end
include AASM
def max_messages_per_hour
account_age_in_seconds = Time.now.utc - created_at
account_age_in_hours = account_age_in_seconds / 3600
- recent_messages = messages.where("sent_on >= ?", Time.now.utc - 3600).count
+ recent_messages = messages.where(:sent_on => Time.now.utc - 3600..).count
max_messages = account_age_in_hours.ceil + recent_messages - (active_reports * 10)
max_messages.clamp(0, Settings.max_messages_per_hour)
end
def max_friends_per_hour
account_age_in_seconds = Time.now.utc - created_at
account_age_in_hours = account_age_in_seconds / 3600
- recent_friends = Friendship.where(:befriendee => self).where("created_at >= ?", Time.now.utc - 3600).count
+ recent_friends = Friendship.where(:befriendee => self).where(:created_at => Time.now.utc - 3600..).count
max_friends = account_age_in_hours.ceil + recent_friends - (active_reports * 10)
max_friends.clamp(0, Settings.max_friends_per_hour)
end
# Author: हिमाल सुबेदी
---
ne:
- html:
- dir: दायाँबाटबायाँ
time:
formats:
friendly: '%e %B %Y मा %H:%M'