Skip to content

Commit

Permalink
Notif radius of 5km and debug motif settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienbeurier committed May 7, 2014
1 parent 0917960 commit e09aacc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ class CreateSnapbyActivitiesAndNotificationsWorker
def perform(snapby_id)
snapby = Snapby.find(snapby_id)

nearby_users = User.select([:id]).within(NOTIFICATION_RADIUS , :origin => [snapby.lat, snapby.lng]).where("id != :snapby_user_id", {snapby_user_id: snapby.user_id})
if Rails.env.development?
nearby_users = User.select([:id]).within(NOTIFICATION_RADIUS , :origin => [snapby.lat, snapby.lng])
else
nearby_users = User.select([:id]).within(NOTIFICATION_RADIUS , :origin => [snapby.lat, snapby.lng]).where("id != :snapby_user_id", {snapby_user_id: snapby.user_id})
end

nearby_user_ids = nearby_users.collect(&:id)

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/constants.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NOTIFICATION_RADIUS = 1 #km
NOTIFICATION_RADIUS = 5 #km
NOTIFICATION_DELAY = 24.hours

ACCEPTED_APIS = [1]
Expand Down

0 comments on commit e09aacc

Please sign in to comment.