# note that this may not be a hard limit - due to timing changes and
# concurrency it is possible that some changesets may be slightly
# longer than strictly allowed or have slightly more changes in them.
# note that this may not be a hard limit - due to timing changes and
# concurrency it is possible that some changesets may be slightly
# longer than strictly allowed or have slightly more changes in them.
def bbox
@bbox ||= [ min_lon, min_lat, max_lon, max_lat ]
end
def bbox
@bbox ||= [ min_lon, min_lat, max_lon, max_lat ]
end
# do the changeset update and the changeset tags update in the
# same transaction to ensure consistency.
# do the changeset update and the changeset tags update in the
# same transaction to ensure consistency.
if (closed_at - created_at) > (MAX_TIME_OPEN - IDLE_TIMEOUT)
self.closed_at = created_at + MAX_TIME_OPEN
else
if (closed_at - created_at) > (MAX_TIME_OPEN - IDLE_TIMEOUT)
self.closed_at = created_at + MAX_TIME_OPEN
else
def update_from(other, user)
# ensure that only the user who opened the changeset may modify it.
unless user.id == self.user_id
def update_from(other, user)
# ensure that only the user who opened the changeset may modify it.
unless user.id == self.user_id