-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- enable_forwarding allows forwarding to be enabled or disabled per device - precise_location allows users to choose whether precise (5dp) or approxmite (3dp + 2dp of noise) locations are stored. On deploying we will need to run migrations, then run rake devices:truncate_and_fuzz_locations in order to truncate the existing locations to 5dp.
- Loading branch information
1 parent
8249a4d
commit e171952
Showing
7 changed files
with
167 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
db/migrate/20240624161155_add_data_policy_fields_to_device.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class AddDataPolicyFieldsToDevice < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :devices, :precise_location, :boolean, null: false, default: false | ||
add_column :devices, :enable_forwarding, :boolean, null: false, default: false | ||
# Existing devices have precise locations, despite the default for all new ones. | ||
execute "UPDATE devices SET precise_location = true" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace :devices do | ||
task :truncate_and_fuzz_locations => :environment do | ||
Device.all.each do |device| | ||
device.truncate_and_fuzz_location! | ||
device.save!(validate: false) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters