]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5731'
authorTom Hughes <tom@compton.nu>
Sat, 1 Mar 2025 12:29:12 +0000 (12:29 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 1 Mar 2025 12:29:12 +0000 (12:29 +0000)
61 files changed:
.annotaterb.yml [new file with mode: 0644]
.github/workflows/lint.yml
Gemfile
Gemfile.lock
app/assets/favicons/manifest.json.erb
app/assets/javascripts/embed.js.erb
app/assets/javascripts/index.js
app/assets/javascripts/index/changeset.js
app/assets/javascripts/index/directions.js
app/assets/javascripts/index/history.js
app/assets/javascripts/index/note.js
app/assets/javascripts/index/query.js
app/assets/javascripts/leaflet.map.js
app/assets/javascripts/leaflet.share.js
app/assets/javascripts/login.js
app/assets/javascripts/matomo.js
app/assets/javascripts/osm.js.erb
app/assets/javascripts/router.js
app/assets/javascripts/welcome.js
app/models/acl.rb
app/models/changeset.rb
app/models/changeset_comment.rb
app/models/changeset_tag.rb
app/models/diary_comment.rb
app/models/diary_entry.rb
app/models/diary_entry_subscription.rb
app/models/follow.rb
app/models/message.rb
app/models/node.rb
app/models/node_tag.rb
app/models/note.rb
app/models/note_comment.rb
app/models/note_subscription.rb
app/models/oauth2_application.rb
app/models/old_node.rb
app/models/old_node_tag.rb
app/models/old_relation.rb
app/models/old_relation_member.rb
app/models/old_relation_tag.rb
app/models/old_way.rb
app/models/old_way_node.rb
app/models/old_way_tag.rb
app/models/redaction.rb
app/models/relation.rb
app/models/relation_member.rb
app/models/relation_tag.rb
app/models/trace.rb
app/models/tracepoint.rb
app/models/tracetag.rb
app/models/user.rb
app/models/user_block.rb
app/models/user_mute.rb
app/models/user_preference.rb
app/models/user_role.rb
app/models/way.rb
app/models/way_node.rb
app/models/way_tag.rb
app/views/accounts/terms/_terms.html.erb
lib/tasks/annotate_rb.rake [new file with mode: 0644]
lib/tasks/auto_annotate_models.rake [deleted file]
test/javascripts/osm_test.js

diff --git a/.annotaterb.yml b/.annotaterb.yml
new file mode 100644 (file)
index 0000000..eab2bb9
--- /dev/null
@@ -0,0 +1,58 @@
+---
+:position: before
+:position_in_additional_file_patterns: before
+:position_in_class: before
+:position_in_factory: before
+:position_in_fixture: before
+:position_in_routes: before
+:position_in_serializer: before
+:position_in_test: before
+:classified_sort: false
+:exclude_controllers: true
+:exclude_factories: true
+:exclude_fixtures: true
+:exclude_helpers: true
+:exclude_scaffolds: true
+:exclude_serializers: true
+:exclude_sti_subclasses: false
+:exclude_tests: true
+:force: false
+:format_markdown: false
+:format_rdoc: false
+:format_yard: false
+:frozen: false
+:ignore_model_sub_dir: false
+:ignore_unknown_models: false
+:include_version: false
+:show_check_constraints: false
+:show_complete_foreign_keys: false
+:show_foreign_keys: true
+:show_indexes: true
+:simple_indexes: false
+:sort: false
+:timestamp: false
+:trace: false
+:with_comment: true
+:with_column_comments: true
+:with_table_comments: true
+:active_admin: false
+:command:
+:debug: false
+:hide_default_column_types: ''
+:hide_limit_column_types: 'integer,bigint,boolean'
+:ignore_columns:
+:ignore_routes:
+:models: true
+:routes: false
+:skip_on_db_migrate: false
+:target_action: :do_annotations
+:wrapper:
+:wrapper_close:
+:wrapper_open:
+:classes_default_to_s: []
+:additional_file_patterns: []
+:model_dir:
+- app/models
+:require: []
+:root_dir:
+- ''
index 433b523f7c866f12defc6717a2807d26fb77dfdc..099d0abf8352c9e386c35bbe4c132b51a3bc49fa 100644 (file)
@@ -86,14 +86,17 @@ jobs:
         ruby-version: ${{ env.ruby }}
         rubygems: 3.4.10
         bundler-cache: true
+    - name: Configure rails
+      run: |
+        cp config/github.database.yml config/database.yml
+        cp config/example.storage.yml config/storage.yml
     - name: Setup database
       run: |
         sudo systemctl start postgresql
         sudo -u postgres createuser -s $(id -un)
         createdb openstreetmap
-        cp config/github.database.yml config/database.yml
         bundle exec rails db:schema:load
     - name: Run Annotate Models
-      run: bundle exec rails annotate_models
+      run: bundle exec annotaterb models
     - name: Fail if model annotations are out of date
       run: git diff --exit-code
diff --git a/Gemfile b/Gemfile
index 660ff7f1a2adba56990d17b7b5454c02d5f5b2e5..ad6b3b3ef2637cc257b7d973de8c1c4eff23d674 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -176,7 +176,7 @@ group :test do
 end
 
 group :development, :test do
-  gem "annotate"
+  gem "annotaterb"
   gem "teaspoon"
   gem "teaspoon-mocha", "~> 2.3.3"
 
index 66f09585dc94479228d5f84e667273ba884a8815..38328c2807c91cb08ed08b5c56a4088131778ae1 100644 (file)
@@ -82,9 +82,7 @@ GEM
       tzinfo (~> 2.0, >= 2.0.5)
     addressable (2.8.7)
       public_suffix (>= 2.0.2, < 7.0)
-    annotate (3.2.0)
-      activerecord (>= 3.2, < 8.0)
-      rake (>= 10.4, < 14.0)
+    annotaterb (4.14.0)
     argon2 (2.3.2)
       ffi (~> 1.15)
       ffi-compiler (~> 1.0)
@@ -682,7 +680,7 @@ DEPENDENCIES
   active_record_union
   activerecord-import
   addressable (~> 2.8)
-  annotate
+  annotaterb
   argon2
   autoprefixer-rails
   aws-sdk-s3
index 0826e884111722c8073ed11e9a6e0aa4f2831c4b..2e97cebc3247e3f4ac25aa90401d67dec766422c 100644 (file)
@@ -1,43 +1,18 @@
 {
        "name": "OpenStreetMap",
-       "icons": [
-               {
-                       "src": "<%= image_path("android-chrome-36x36.png").gsub("/", "\\/") %>",
-                       "sizes": "36x36",
-                       "type": "image\/png",
-                       "density": "0.75"
-               },
-               {
-                       "src": "<%= image_path("android-chrome-48x48.png").gsub("/", "\\/") %>",
-                       "sizes": "48x48",
-                       "type": "image\/png",
-                       "density": "1.0"
-               },
-               {
-                       "src": "<%= image_path("android-chrome-72x72.png").gsub("/", "\\/") %>",
-                       "sizes": "72x72",
-                       "type": "image\/png",
-                       "density": "1.5"
-               },
-               {
-                       "src": "<%= image_path("android-chrome-96x96.png").gsub("/", "\\/") %>",
-                       "sizes": "96x96",
-                       "type": "image\/png",
-                       "density": "2.0"
-               },
-               {
-                       "src": "<%= image_path("android-chrome-144x144.png").gsub("/", "\\/") %>",
-                       "sizes": "144x144",
-                       "type": "image\/png",
-                       "density": "3.0"
-               },
-               {
-                       "src": "<%= image_path("android-chrome-192x192.png").gsub("/", "\\/") %>",
-                       "sizes": "192x192",
-                       "type": "image\/png",
-                       "density": "4.0"
-               }
-       ],
+       "short_name": "OSM",
+       "icons": <%= [36, 48, 72, 96, 144, 192].map { |res| {
+                       src: image_path("android-chrome-#{res}x#{res}.png"),
+                       sizes: "#{res}x#{res}",
+                       type: "image/png",
+                       density: res.to_f / 48
+               } }.push({
+                       src: image_path("../images/osm_logo.svg"),
+                       sizes: "any",
+                       type: "image/svg+xml"
+               }).to_json %>,
        "start_url": "/",
+       "theme_color": "#7ebc6f",
+       "background_color": "#fff",
        "display": "minimal-ui"
 }
index aff13add80debee64834bcf9b8852a0c4201840e..7596e89a438dd3aa29ff17dedc4057167f05a12c 100644 (file)
@@ -16,7 +16,7 @@ I18n.default_locale = <%= I18n.default_locale.to_json %>;
 I18n.fallbacks = true;
 
 window.onload = function () {
-  const args = Object.fromEntries(new URLSearchParams(window.location.search));
+  const args = Object.fromEntries(new URLSearchParams(location.search));
 
   const tileOptions = {
     mapnik: {
index 96870f600869ab92c99a550820eeaecf499edebc..9888b3a7e5fc0abaefb76c141e289e1ce297f390 100644 (file)
@@ -311,7 +311,7 @@ $(document).ready(function () {
     };
 
     function addObject(type, id, version, center) {
-      const hashParams = OSM.parseHash(window.location.hash);
+      const hashParams = OSM.parseHash(location.hash);
       map.addObject({ type: type, id: parseInt(id, 10), version: version && parseInt(version, 10) }, function (bounds) {
         if (!hashParams.center && bounds.isValid() &&
             (center || !map.getBounds().contains(bounds))) {
@@ -363,7 +363,7 @@ $(document).ready(function () {
     "/account/home": OSM.Home(map)
   });
 
-  if (OSM.preferred_editor === "remote" && document.location.pathname === "/edit") {
+  if (OSM.preferred_editor === "remote" && location.pathname === "/edit") {
     remoteEditHandler(map.getBounds(), params.object);
     OSM.router.setCurrentPath("/");
   }
index 6c1c6a2df7a2df382120f7c23da38b2cf4be859f..6feefbc2dc0217d7645de3f0b8464a8b1d355a19 100644 (file)
@@ -12,7 +12,7 @@ OSM.Changeset = function (map) {
     const changesetData = content.find("[data-changeset]").data("changeset");
     changesetData.type = "changeset";
 
-    const hashParams = OSM.parseHash(window.location.hash);
+    const hashParams = OSM.parseHash(location.hash);
     initialize();
     map.addObject(changesetData, function (bounds) {
       if (!hashParams.center && bounds.isValid()) {
@@ -45,7 +45,7 @@ OSM.Changeset = function (map) {
         });
       })
       .then(() => {
-        OSM.loadSidebarContent(window.location.pathname, page.load);
+        OSM.loadSidebarContent(location.pathname, page.load);
       })
       .catch(error => {
         content.find("button[data-method][data-url]").prop("disabled", false);
index c6f83a575e04bc2cc9f0a84a95bdf35666306f81..40ca85d960fc6f0d29504761a1bb8eeb2b4ab581 100644 (file)
@@ -273,13 +273,15 @@ OSM.Directions = function (map) {
     map.fire("startinglocation", { latlng: [lat, lng] });
   }
 
+  function startingLocationListener({ latlng }) {
+    if (endpoints[0].value) return;
+    endpoints[0].setValue(latlng.join(", "));
+  }
+
   map.on("locationfound", ({ latlng: { lat, lng } }) =>
     lastLocation = [lat, lng]
   ).on("locateactivate", () => {
-    map.once("startinglocation", ({ latlng }) => {
-      if (endpoints[0].value) return;
-      endpoints[0].setValue(latlng.join(", "));
-    });
+    map.once("startinglocation", startingLocationListener);
   });
 
   const page = {};
@@ -344,7 +346,7 @@ OSM.Directions = function (map) {
 OSM.Directions.engines = [];
 
 OSM.Directions.addEngine = function (engine, supportsHTTPS) {
-  if (document.location.protocol === "http:" || supportsHTTPS) {
+  if (location.protocol === "http:" || supportsHTTPS) {
     engine.id = engine.provider + "_" + engine.mode;
     OSM.Directions.engines.push(engine);
   }
index c36ae5f185683d58eddf99946e90bab7bd1bcc3c..6e4e73a23fa7e5564bcad943a6b78f4111a96680 100644 (file)
@@ -58,7 +58,7 @@ OSM.History = function (map) {
   function update() {
     const data = new URLSearchParams();
 
-    if (window.location.pathname === "/history") {
+    if (location.pathname === "/history") {
       data.set("bbox", map.getBounds().wrap().toBBoxString());
       const feedLink = $("link[type=\"application/atom+xml\"]"),
             feedHref = feedLink.attr("href").split("?")[0];
@@ -67,7 +67,7 @@ OSM.History = function (map) {
 
     data.set("list", "1");
 
-    fetch(window.location.pathname + "?" + data)
+    fetch(location.pathname + "?" + data)
       .then(response => response.text())
       .then(function (html) {
         displayFirstChangesets(html);
@@ -137,7 +137,7 @@ OSM.History = function (map) {
 
     updateBounds();
 
-    if (window.location.pathname !== "/history") {
+    if (location.pathname !== "/history") {
       const bounds = group.getBounds();
       if (bounds.isValid()) map.fitBounds(bounds);
     }
@@ -150,7 +150,7 @@ OSM.History = function (map) {
   page.load = function () {
     map.addLayer(group);
 
-    if (window.location.pathname === "/history") {
+    if (location.pathname === "/history") {
       map.on("moveend", update);
     }
 
index b9310a1af9e159d159dcef7254988d8623dc3983..3e8cbce1ba7870da38c2d4e070222a84c154a806 100644 (file)
@@ -79,7 +79,7 @@ OSM.Note = function (map) {
     const data = $(".details").data();
 
     if (data) {
-      const hashParams = OSM.parseHash(window.location.hash);
+      const hashParams = OSM.parseHash(location.hash);
       map.addObject({
         type: "note",
         id: parseInt(id, 10),
index ee9d3f41560c9a6ef9441b9fcac2d36dc1c13154..c0395c70182438a55854a8ce2068f552807d2f6b 100644 (file)
@@ -326,7 +326,7 @@ OSM.Query = function (map) {
     const params = new URLSearchParams(path.substring(path.indexOf("?"))),
           latlng = L.latLng(params.get("lat"), params.get("lon"));
 
-    if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) {
+    if (!location.hash && !noCentre && !map.getBounds().contains(latlng)) {
       OSM.router.withoutMoveListener(function () {
         map.setView(latlng, 15);
       });
index 34c0bd449174a962e61124d3bd14f575999112ce..6adf2138d79c65c3826a10bce5b82a9617e0e3eb 100644 (file)
@@ -155,7 +155,7 @@ L.OSM.Map = L.Map.extend({
       [params.mlat, params.mlon] = OSM.cropLocation(marker.getLatLng(), this.getZoom());
     }
 
-    let url = window.location.protocol + "//" + OSM.SERVER_URL + "/";
+    let url = location.protocol + "//" + OSM.SERVER_URL + "/";
     const query = new URLSearchParams(params),
           hash = OSM.formatHash(this);
 
@@ -176,7 +176,7 @@ L.OSM.Map = L.Map.extend({
           // and drops the last 4 bits of the full 64 bit Morton code.
           c1 = interlace(x >>> 17, y >>> 17),
           c2 = interlace((x >>> 2) & 0x7fff, (y >>> 2) & 0x7fff);
-    let str = window.location.protocol + "//" + window.location.hostname.replace(/^www\.openstreetmap\.org/i, "osm.org") + "/go/";
+    let str = location.protocol + "//" + location.hostname.replace(/^www\.openstreetmap\.org/i, "osm.org") + "/go/";
 
     for (let i = 0; i < Math.ceil((zoom + 8) / 3.0) && i < 5; ++i) {
       const digit = (c1 >> (24 - (6 * i))) & 0x3f;
index 42e195f0af1aa46a77053c290b484dd975234992..d84f8820e3e0a37966470cc8ac43c88bf9dabd1f 100644 (file)
@@ -159,6 +159,7 @@ L.OSM.share = function (options) {
           .attr("class", "form-select w-auto")
           .append($("<option>").val("png").text("PNG").prop("selected", true))
           .append($("<option>").val("jpeg").text("JPEG"))
+          .append($("<option>").val("webp").text("WEBP"))
           .append($("<option>").val("svg").text("SVG"))
           .append($("<option>").val("pdf").text("PDF"))));
 
index 83ca4d440dd3b238797529b252a6684b5729dca6..078792821e69954c337bca8f220ec9212f5ef626 100644 (file)
@@ -1,6 +1,6 @@
 $(document).ready(function () {
   // Preserve location hash in referer
-  if (window.location.hash) {
-    $("#referer").val($("#referer").val() + window.location.hash);
+  if (location.hash) {
+    $("#referer").val($("#referer").val() + location.hash);
   }
 });
index 4ed3de941bfc05255f5bc33f228a00fb2c822c76..2c9968b08097ab7afd34266bdca38bef13be0941 100644 (file)
@@ -1,6 +1,6 @@
 if (OSM.MATOMO) {
   $(document).ready(function () {
-    const base = document.location.protocol + "//" + OSM.MATOMO.location + "/";
+    const base = location.protocol + "//" + OSM.MATOMO.location + "/";
     let matomoTracker;
 
     const matomoLoader = $.ajax({
index 25d6596c2cd6fb160ef54bdba6641ee79e6c8a76..a40ae6eb87995c1d031cf03330bcae422af0a58b 100644 (file)
@@ -57,7 +57,7 @@ OSM = {
   },
 
   params: function (search) {
-    const query = search || window.location.search;
+    const query = search || location.search;
     return Object.fromEntries(new URLSearchParams(query));
   },
 
index 2e4b375d79691b0bd7253fce4bcf8671530465b9..22795195cd06660c2593aa44abc741e7fb7c40a4 100644 (file)
@@ -93,7 +93,7 @@ OSM.Router = function (map, rts) {
     }
   };
 
-  let currentPath = window.location.pathname.replace(/(.)\/$/, "$1") + window.location.search,
+  let currentPath = location.pathname.replace(/(.)\/$/, "$1") + location.search,
       currentRoute = routes.recognize(currentPath),
       currentHash = location.hash || OSM.formatHash(map);
 
@@ -101,7 +101,7 @@ OSM.Router = function (map, rts) {
 
   function updateSecondaryNav() {
     $("header nav.secondary > ul > li > a").each(function () {
-      const active = $(this).attr("href") === window.location.pathname;
+      const active = $(this).attr("href") === location.pathname;
 
       $(this)
         .toggleClass("text-secondary", !active)
@@ -111,7 +111,7 @@ OSM.Router = function (map, rts) {
 
   $(window).on("popstate", function (e) {
     if (!e.originalEvent.state) return; // Is it a real popstate event or just a hash change?
-    const path = window.location.pathname + window.location.search,
+    const path = location.pathname + location.search,
           route = routes.recognize(path);
     if (path === currentPath) return;
     currentRoute.run("unload", null, route === currentRoute);
@@ -142,7 +142,7 @@ OSM.Router = function (map, rts) {
   };
 
   router.stateChange = function (state) {
-    const url = state.center ? OSM.formatHash(state) : window.location;
+    const url = state.center ? OSM.formatHash(state) : location;
     window.history.replaceState(state, document.title, url);
   };
 
index 3e2845bb3bda0e8a0404a30661cd1e07f27f377c..41d45bbf8ee9a40a212e94116c9bd32ebdd6a77f 100644 (file)
@@ -27,7 +27,7 @@ $(document).ready(function () {
   }
 
   function geoSuccess(position) {
-    window.location = "/edit" + OSM.formatHash({
+    location = "/edit" + OSM.formatHash({
       zoom: 17,
       lat: position.coords.latitude,
       lon: position.coords.longitude
@@ -35,6 +35,6 @@ $(document).ready(function () {
   }
 
   function manualEdit() {
-    window.location = "/?edit_help=1";
+    location = "/?edit_help=1";
   }
 });
index aa503f40c539647dfb9d66aea990b57e6f8c76c6..81e720159b09ad38ff2c6c3e7aa882f19f199341 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: acls
 #
-#  id      :bigint(8)        not null, primary key
+#  id      :bigint           not null, primary key
 #  address :inet
 #  k       :string           not null
 #  v       :string
index e6bde19a50d8562f63e12e44be146a72e5905ac9..50b30c1a4c6c409fd890f343f5f62503095a0cdd 100644 (file)
@@ -2,8 +2,8 @@
 #
 # Table name: changesets
 #
-#  id          :bigint(8)        not null, primary key
-#  user_id     :bigint(8)        not null
+#  id          :bigint           not null, primary key
+#  user_id     :bigint           not null
 #  created_at  :datetime         not null
 #  min_lat     :integer
 #  max_lat     :integer
index d825c9ed58d4fe1f3ef99937278238848585a654..09eabe8938d182654a0557ffcf9d516f395264a2 100644 (file)
@@ -3,8 +3,8 @@
 # Table name: changeset_comments
 #
 #  id           :integer          not null, primary key
-#  changeset_id :bigint(8)        not null
-#  author_id    :bigint(8)        not null
+#  changeset_id :bigint           not null
+#  author_id    :bigint           not null
 #  body         :text             not null
 #  created_at   :datetime         not null
 #  visible      :boolean          not null
index da9fbce51a4732833cd86f0349caf1aab5a2e530..6b848e1c98f7db33ce181385b2873b7bc940c51d 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: changeset_tags
 #
-#  changeset_id :bigint(8)        not null, primary key
+#  changeset_id :bigint           not null, primary key
 #  k            :string           default(""), not null, primary key
 #  v            :string           default(""), not null
 #
index ad23c9f65f3b6435814a3e6484ab1e7b41cc7b6b..539e7532cca3f74107429697a439eaf05ded264b 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: diary_comments
 #
-#  id             :bigint(8)        not null, primary key
-#  diary_entry_id :bigint(8)        not null
-#  user_id        :bigint(8)        not null
+#  id             :bigint           not null, primary key
+#  diary_entry_id :bigint           not null
+#  user_id        :bigint           not null
 #  body           :text             not null
 #  created_at     :datetime         not null
 #  updated_at     :datetime         not null
index 089c7e6c60fecb1ebcc92238a00eb0d1e37a7c9e..ad9659438d71e6a0b176f8b649b8fed49161f896 100644 (file)
@@ -2,8 +2,8 @@
 #
 # Table name: diary_entries
 #
-#  id            :bigint(8)        not null, primary key
-#  user_id       :bigint(8)        not null
+#  id            :bigint           not null, primary key
+#  user_id       :bigint           not null
 #  title         :string           not null
 #  body          :text             not null
 #  created_at    :datetime         not null
index 93b8847f433f655ee673ad339053f5dd460ec126..31a5806ebf924ad8fc5b7c2611885274affd4ea9 100644 (file)
@@ -2,8 +2,8 @@
 #
 # Table name: diary_entry_subscriptions
 #
-#  user_id        :bigint(8)        not null, primary key
-#  diary_entry_id :bigint(8)        not null, primary key
+#  user_id        :bigint           not null, primary key
+#  diary_entry_id :bigint           not null, primary key
 #
 # Indexes
 #
index ebf3ad735da1c5dd2f3fa050506060aa1cdc888c..6dd1bfe03162ca0173f613bfb86a3522c3767bbb 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: friends
 #
-#  id             :bigint(8)        not null, primary key
-#  user_id        :bigint(8)        not null
-#  friend_user_id :bigint(8)        not null
+#  id             :bigint           not null, primary key
+#  user_id        :bigint           not null
+#  friend_user_id :bigint           not null
 #  created_at     :datetime
 #
 # Indexes
index 665e2d721376b897738691c73cf4a62c0bc3bd4b..28320af78f3c8de52746ecab86ef09b3f49cf409 100644 (file)
@@ -2,13 +2,13 @@
 #
 # Table name: messages
 #
-#  id                :bigint(8)        not null, primary key
-#  from_user_id      :bigint(8)        not null
+#  id                :bigint           not null, primary key
+#  from_user_id      :bigint           not null
 #  title             :string           not null
 #  body              :text             not null
 #  sent_on           :datetime         not null
 #  message_read      :boolean          default(FALSE), not null
-#  to_user_id        :bigint(8)        not null
+#  to_user_id        :bigint           not null
 #  to_user_visible   :boolean          default(TRUE), not null
 #  from_user_visible :boolean          default(TRUE), not null
 #  body_format       :enum             default("markdown"), not null
index 1bec9a33cfa05968c040904182ab12b14e8e588f..baf0c180f3f069260a960e5e56c11670442116df 100644 (file)
@@ -2,14 +2,14 @@
 #
 # Table name: current_nodes
 #
-#  id           :bigint(8)        not null, primary key
+#  id           :bigint           not null, primary key
 #  latitude     :integer          not null
 #  longitude    :integer          not null
-#  changeset_id :bigint(8)        not null
+#  changeset_id :bigint           not null
 #  visible      :boolean          not null
 #  timestamp    :datetime         not null
-#  tile         :bigint(8)        not null
-#  version      :bigint(8)        not null
+#  tile         :bigint           not null
+#  version      :bigint           not null
 #
 # Indexes
 #
index 18e502439b18499fe505eeaee239a1b2b5d4e5ed..fa82b6a3c52b9a73be64967c065efa33f5429e39 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: current_node_tags
 #
-#  node_id :bigint(8)        not null, primary key
+#  node_id :bigint           not null, primary key
 #  k       :string           default(""), not null, primary key
 #  v       :string           default(""), not null
 #
index 0a1f4abd7fed5594c0560180d5c77163a4066a02..2ec72a03ac6fd5bf228d3319546fd6700e140995 100644 (file)
@@ -2,16 +2,16 @@
 #
 # Table name: notes
 #
-#  id          :bigint(8)        not null, primary key
+#  id          :bigint           not null, primary key
 #  latitude    :integer          not null
 #  longitude   :integer          not null
-#  tile        :bigint(8)        not null
+#  tile        :bigint           not null
 #  updated_at  :datetime         not null
 #  created_at  :datetime         not null
 #  status      :enum             not null
 #  closed_at   :datetime
 #  description :text             default(""), not null
-#  user_id     :bigint(8)
+#  user_id     :bigint
 #  user_ip     :inet
 #
 # Indexes
index d318c5e95aa8272332765437da303c1234970fd6..3f34368fa8073608723656f1043b0462945772c0 100644 (file)
@@ -2,12 +2,12 @@
 #
 # Table name: note_comments
 #
-#  id         :bigint(8)        not null, primary key
-#  note_id    :bigint(8)        not null
+#  id         :bigint           not null, primary key
+#  note_id    :bigint           not null
 #  visible    :boolean          not null
 #  created_at :datetime         not null
 #  author_ip  :inet
-#  author_id  :bigint(8)
+#  author_id  :bigint
 #  body       :text
 #  event      :enum
 #
index 76e8a226cb73a1a47037fd1f979524fc49406358..2532738bc79653eebf3278257f59f6ab974fead8 100644 (file)
@@ -2,8 +2,8 @@
 #
 # Table name: note_subscriptions
 #
-#  user_id :bigint(8)        not null, primary key
-#  note_id :bigint(8)        not null, primary key
+#  user_id :bigint           not null, primary key
+#  note_id :bigint           not null, primary key
 #
 # Indexes
 #
index 834f1ded54393b6d8587f5fbc241f6980bee3b9a..9a099e30415dd9705ee4cc458bdc49f3b3003858 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: oauth_applications
 #
-#  id           :bigint(8)        not null, primary key
+#  id           :bigint           not null, primary key
 #  owner_type   :string           not null
-#  owner_id     :bigint(8)        not null
+#  owner_id     :bigint           not null
 #  name         :string           not null
 #  uid          :string           not null
 #  secret       :string           not null
index f29eed9dda9cbaf7d3532fde9cd22432eca08b1f..bb4022ba33aee65cba3d2d2951fbd1f31cf2ef17 100644 (file)
@@ -2,14 +2,14 @@
 #
 # Table name: nodes
 #
-#  node_id      :bigint(8)        not null, primary key
+#  node_id      :bigint           not null, primary key
 #  latitude     :integer          not null
 #  longitude    :integer          not null
-#  changeset_id :bigint(8)        not null
+#  changeset_id :bigint           not null
 #  visible      :boolean          not null
 #  timestamp    :datetime         not null
-#  tile         :bigint(8)        not null
-#  version      :bigint(8)        not null, primary key
+#  tile         :bigint           not null
+#  version      :bigint           not null, primary key
 #  redaction_id :integer
 #
 # Indexes
index 503ecf27adaee5820f6b53bb003e3272531b3e20..cae61a2c5ef4f82bd12fe070d4a7ab36dffd6630 100644 (file)
@@ -2,14 +2,14 @@
 #
 # Table name: node_tags
 #
-#  node_id :bigint(8)        not null, primary key
-#  version :bigint(8)        not null, primary key
+#  node_id :bigint           not null, primary key
+#  version :bigint           not null, primary key
 #  k       :string           default(""), not null, primary key
 #  v       :string           default(""), not null
 #
 # Foreign Keys
 #
-#  node_tags_id_fkey  (["node_id", "version"] => nodes.["node_id", "version"])
+#  node_tags_id_fkey  ([node_id, version] => nodes[node_id, version])
 #
 
 class OldNodeTag < ApplicationRecord
index 9f551d839fc2c57be000f37f67ccd952ec9a313c..42f363f0ef2c5b5e216bc4439f207d978c863909 100644 (file)
@@ -2,10 +2,10 @@
 #
 # Table name: relations
 #
-#  relation_id  :bigint(8)        not null, primary key
-#  changeset_id :bigint(8)        not null
+#  relation_id  :bigint           not null, primary key
+#  changeset_id :bigint           not null
 #  timestamp    :datetime         not null
-#  version      :bigint(8)        not null, primary key
+#  version      :bigint           not null, primary key
 #  visible      :boolean          default(TRUE), not null
 #  redaction_id :integer
 #
index 6d5aaf5c9653861db673981fd73b5eb5fcba12c6..2e723c5bd5c8eefb47d6aae0bf489888e788c2ff 100644 (file)
@@ -2,11 +2,11 @@
 #
 # Table name: relation_members
 #
-#  relation_id :bigint(8)        not null, primary key
+#  relation_id :bigint           not null, primary key
 #  member_type :enum             not null
-#  member_id   :bigint(8)        not null
+#  member_id   :bigint           not null
 #  member_role :string           not null
-#  version     :bigint(8)        default(0), not null, primary key
+#  version     :bigint           default(0), not null, primary key
 #  sequence_id :integer          default(0), not null, primary key
 #
 # Indexes
@@ -15,7 +15,7 @@
 #
 # Foreign Keys
 #
-#  relation_members_id_fkey  (["relation_id", "version"] => relations.["relation_id", "version"])
+#  relation_members_id_fkey  ([relation_id, version] => relations[relation_id, version])
 #
 
 class OldRelationMember < ApplicationRecord
index 39566aeb97b2c321636f30b19eb8a850bc36bcc8..0817454129b7feb1ac1bc4cd006fb71ddc466fc7 100644 (file)
@@ -2,14 +2,14 @@
 #
 # Table name: relation_tags
 #
-#  relation_id :bigint(8)        not null, primary key
+#  relation_id :bigint           not null, primary key
 #  k           :string           default(""), not null, primary key
 #  v           :string           default(""), not null
-#  version     :bigint(8)        not null, primary key
+#  version     :bigint           not null, primary key
 #
 # Foreign Keys
 #
-#  relation_tags_id_fkey  (["relation_id", "version"] => relations.["relation_id", "version"])
+#  relation_tags_id_fkey  ([relation_id, version] => relations[relation_id, version])
 #
 
 class OldRelationTag < ApplicationRecord
index 0c53f90bdbe2f84f1fc885499fe05cb27bbf4311..a9c55cf3064b73f48ef4a95162f9492d62c4b1ed 100644 (file)
@@ -2,10 +2,10 @@
 #
 # Table name: ways
 #
-#  way_id       :bigint(8)        not null, primary key
-#  changeset_id :bigint(8)        not null
+#  way_id       :bigint           not null, primary key
+#  changeset_id :bigint           not null
 #  timestamp    :datetime         not null
-#  version      :bigint(8)        not null, primary key
+#  version      :bigint           not null, primary key
 #  visible      :boolean          default(TRUE), not null
 #  redaction_id :integer
 #
index b2a16c16b39af7cefe8646e0c17bde05953641b3..714b38648de0d13b304132e7131064e023912f06 100644 (file)
@@ -2,10 +2,10 @@
 #
 # Table name: way_nodes
 #
-#  way_id      :bigint(8)        not null, primary key
-#  node_id     :bigint(8)        not null
-#  version     :bigint(8)        not null, primary key
-#  sequence_id :bigint(8)        not null, primary key
+#  way_id      :bigint           not null, primary key
+#  node_id     :bigint           not null
+#  version     :bigint           not null, primary key
+#  sequence_id :bigint           not null, primary key
 #
 # Indexes
 #
@@ -13,7 +13,7 @@
 #
 # Foreign Keys
 #
-#  way_nodes_id_fkey  (["way_id", "version"] => ways.["way_id", "version"])
+#  way_nodes_id_fkey  ([way_id, version] => ways[way_id, version])
 #
 
 class OldWayNode < ApplicationRecord
index 82ce132ec8bf8051399bc246f6752f5a532c9811..32aea5b1588f5c7c57cc50b55a099aa986ed4569 100644 (file)
@@ -2,14 +2,14 @@
 #
 # Table name: way_tags
 #
-#  way_id  :bigint(8)        not null, primary key
+#  way_id  :bigint           not null, primary key
 #  k       :string           not null, primary key
 #  v       :string           not null
-#  version :bigint(8)        not null, primary key
+#  version :bigint           not null, primary key
 #
 # Foreign Keys
 #
-#  way_tags_id_fkey  (["way_id", "version"] => ways.["way_id", "version"])
+#  way_tags_id_fkey  ([way_id, version] => ways[way_id, version])
 #
 
 class OldWayTag < ApplicationRecord
index 5e9e0decde935a87b1514e3a8ffec16085026b79..7b25c6323195026b90e39d102be6bb504ebfbbe1 100644 (file)
@@ -7,7 +7,7 @@
 #  description        :text             not null
 #  created_at         :datetime
 #  updated_at         :datetime
-#  user_id            :bigint(8)        not null
+#  user_id            :bigint           not null
 #  description_format :enum             default("markdown"), not null
 #
 # Foreign Keys
index 69e2acfd19ce3222f425c9734d983ede7b630101..0742976e8d125c937eea66afcb4bfe787f90dcc3 100644 (file)
@@ -2,11 +2,11 @@
 #
 # Table name: current_relations
 #
-#  id           :bigint(8)        not null, primary key
-#  changeset_id :bigint(8)        not null
+#  id           :bigint           not null, primary key
+#  changeset_id :bigint           not null
 #  timestamp    :datetime         not null
 #  visible      :boolean          not null
-#  version      :bigint(8)        not null
+#  version      :bigint           not null
 #
 # Indexes
 #
index 2b72cd2b182595bd6f6abb2d138559c700572103..c9723e48b5b2cab776060d9606866e807856ccf5 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: current_relation_members
 #
-#  relation_id :bigint(8)        not null, primary key
+#  relation_id :bigint           not null, primary key
 #  member_type :enum             not null
-#  member_id   :bigint(8)        not null
+#  member_id   :bigint           not null
 #  member_role :string           not null
 #  sequence_id :integer          default(0), not null, primary key
 #
index 500b7d910825338fa3ec452b3b184b45a9b706a6..d23192b8e71584b11193c25475fdad272228fc11 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: current_relation_tags
 #
-#  relation_id :bigint(8)        not null, primary key
+#  relation_id :bigint           not null, primary key
 #  k           :string           default(""), not null, primary key
 #  v           :string           default(""), not null
 #
index 4d71b4b2933d02fdd63453147970f36d8369b24e..3001d052c0e8783f7d159cbd5a49677598dba485 100644 (file)
@@ -2,11 +2,11 @@
 #
 # Table name: gpx_files
 #
-#  id          :bigint(8)        not null, primary key
-#  user_id     :bigint(8)        not null
+#  id          :bigint           not null, primary key
+#  user_id     :bigint           not null
 #  visible     :boolean          default(TRUE), not null
 #  name        :string           default(""), not null
-#  size        :bigint(8)
+#  size        :bigint
 #  latitude    :float
 #  longitude   :float
 #  timestamp   :datetime         not null
index d36ceb8c3c52606f21e74489ef2eabfeddc97169..198d8cd3e8914566ee0baf12d12abcf3d7502de5 100644 (file)
@@ -6,9 +6,9 @@
 #  trackid   :integer          not null
 #  latitude  :integer          not null
 #  longitude :integer          not null
-#  gpx_id    :bigint(8)        not null
+#  gpx_id    :bigint           not null
 #  timestamp :datetime
-#  tile      :bigint(8)
+#  tile      :bigint
 #
 # Indexes
 #
index b1dde095c18f7793e524a704f0d7db8550b0f51a..0e9fe126d43dedd182dccffdd661b9ca0f9fd849 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: gpx_file_tags
 #
-#  gpx_id :bigint(8)        not null
+#  gpx_id :bigint           not null
 #  tag    :string           not null
-#  id     :bigint(8)        not null, primary key
+#  id     :bigint           not null, primary key
 #
 # Indexes
 #
index 8d061e26bb626cd7c1a42fe9d6c6fb8e72e044fe..a63846e421f917044560852bb3c07ded3ed00649 100644 (file)
@@ -3,7 +3,7 @@
 # Table name: users
 #
 #  email                :string           not null
-#  id                   :bigint(8)        not null, primary key
+#  id                   :bigint           not null, primary key
 #  pass_crypt           :string           not null
 #  creation_time        :datetime         not null
 #  display_name         :string           default(""), not null
@@ -28,7 +28,7 @@
 #  diary_entries_count  :integer          default(0), not null
 #  image_use_gravatar   :boolean          default(FALSE), not null
 #  auth_provider        :string
-#  home_tile            :bigint(8)
+#  home_tile            :bigint
 #  tou_agreed           :datetime
 #  diary_comments_count :integer          default(0)
 #  note_comments_count  :integer          default(0)
index 61235c418d079a34944aff3c4f0de93ae5e1b121..f25bd47b87d768b9d0ed0f3867f7e4e5695e898b 100644 (file)
@@ -3,12 +3,12 @@
 # Table name: user_blocks
 #
 #  id             :integer          not null, primary key
-#  user_id        :bigint(8)        not null
-#  creator_id     :bigint(8)        not null
+#  user_id        :bigint           not null
+#  creator_id     :bigint           not null
 #  reason         :text             not null
 #  ends_at        :datetime         not null
 #  needs_view     :boolean          default(FALSE), not null
-#  revoker_id     :bigint(8)
+#  revoker_id     :bigint
 #  created_at     :datetime
 #  updated_at     :datetime
 #  reason_format  :enum             default("markdown"), not null
index 9bee39b8d8e15828a698c66513b6d11de54d418d..68f3bb67961d6a0ee59bc5faf09b27dde2ffbf1a 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: user_mutes
 #
-#  id         :bigint(8)        not null, primary key
-#  owner_id   :bigint(8)        not null
-#  subject_id :bigint(8)        not null
+#  id         :bigint           not null, primary key
+#  owner_id   :bigint           not null
+#  subject_id :bigint           not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
 #
index 5b91bbda91badfe4f4242c9fc6a5a563b4cdcd19..35412c9e783afb83cc8e6da0b8dc8243610a4ae9 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: user_preferences
 #
-#  user_id :bigint(8)        not null, primary key
+#  user_id :bigint           not null, primary key
 #  k       :string           not null, primary key
 #  v       :string           not null
 #
index 332848e420ffec509d270267e81f281ee4502bef..d374b4084e08e8fef0385c74fdfba82393ddb473 100644 (file)
@@ -3,11 +3,11 @@
 # Table name: user_roles
 #
 #  id         :integer          not null, primary key
-#  user_id    :bigint(8)        not null
-#  role       :enum             not null
+#  user_id    :bigint           not null
 #  created_at :datetime
 #  updated_at :datetime
-#  granter_id :bigint(8)        not null
+#  role       :enum             not null
+#  granter_id :bigint           not null
 #
 # Indexes
 #
index 203d3b7036f4c78d4b844b8219f14acfd73e59e6..7357a280f52eda40f2004d028763a4696c524076 100644 (file)
@@ -2,11 +2,11 @@
 #
 # Table name: current_ways
 #
-#  id           :bigint(8)        not null, primary key
-#  changeset_id :bigint(8)        not null
+#  id           :bigint           not null, primary key
+#  changeset_id :bigint           not null
 #  timestamp    :datetime         not null
 #  visible      :boolean          not null
-#  version      :bigint(8)        not null
+#  version      :bigint           not null
 #
 # Indexes
 #
index c57d3be79a8a4b1651ec24354970e2bcdda2e954..b77827ada35a5605d8641502000c99f5d6622bf5 100644 (file)
@@ -2,9 +2,9 @@
 #
 # Table name: current_way_nodes
 #
-#  way_id      :bigint(8)        not null, primary key
-#  node_id     :bigint(8)        not null
-#  sequence_id :bigint(8)        not null, primary key
+#  way_id      :bigint           not null, primary key
+#  node_id     :bigint           not null
+#  sequence_id :bigint           not null, primary key
 #
 # Indexes
 #
index 04ce7abf552e9c2ed4f1565761dd2e531991358c..2bf7fa887cd01e176b33f61b7a477694650ee51d 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Table name: current_way_tags
 #
-#  way_id :bigint(8)        not null, primary key
+#  way_id :bigint           not null, primary key
 #  k      :string           default(""), not null, primary key
 #  v      :string           default(""), not null
 #
index 6a70a88f19fe9113370f7e764376b5fa70d5eb47..20c6a7a8e12d13dab0f96088518e047ed669abde 100644 (file)
@@ -23,7 +23,6 @@
     <p><%= @text["section_3"] %></p>
     <p><%= @text["active_defn_1"] %></p>
     <p><%= @text["active_defn_2"] %></p>
-    </ul>
   </li>
   <li>
     <p><%= @text["section_4"] %></p>
diff --git a/lib/tasks/annotate_rb.rake b/lib/tasks/annotate_rb.rake
new file mode 100644 (file)
index 0000000..1ad0ec3
--- /dev/null
@@ -0,0 +1,8 @@
+# This rake task was added by annotate_rb gem.
+
+# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
+if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
+  require "annotate_rb"
+
+  AnnotateRb::Core.load_rake_tasks
+end
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake
deleted file mode 100644 (file)
index e5ea370..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# NOTE: only doing this in development as some production environments (Heroku)
-# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
-# NOTE: to have a dev-mode tool do its thing in production.
-if Rails.env.local?
-  task :set_annotation_options => :environment do
-    # You can override any of these by setting an environment variable of the
-    # same name.
-    Annotate.set_defaults(
-      "routes" => "false",
-      "position_in_routes" => "before",
-      "position_in_class" => "before",
-      "position_in_test" => "before",
-      "position_in_fixture" => "before",
-      "position_in_factory" => "before",
-      "position_in_serializer" => "before",
-      "show_foreign_keys" => "true",
-      "show_indexes" => "true",
-      "simple_indexes" => "false",
-      "model_dir" => "app/models",
-      "root_dir" => "",
-      "include_version" => "false",
-      "require" => "",
-      "exclude_tests" => "true",
-      "exclude_fixtures" => "true",
-      "exclude_factories" => "true",
-      "exclude_serializers" => "true",
-      "exclude_scaffolds" => "true",
-      "exclude_controllers" => "true",
-      "exclude_helpers" => "true",
-      "ignore_model_sub_dir" => "false",
-      "ignore_columns" => nil,
-      "ignore_routes" => nil,
-      "ignore_unknown_models" => "false",
-      "hide_limit_column_types" => "integer,boolean",
-      "skip_on_db_migrate" => "false",
-      "format_bare" => "true",
-      "format_rdoc" => "false",
-      "format_markdown" => "false",
-      "sort" => "false",
-      "force" => "false",
-      "trace" => "false",
-      "wrapper_open" => nil,
-      "wrapper_close" => nil
-    )
-  end
-
-  Annotate.load_tasks
-end
index 877af5ad71adf783aaadc38e54447af99ffd34cd..2f96ccb3d4a2de806ab3bca1a806847672c42d74 100644 (file)
@@ -33,7 +33,7 @@ describe("OSM", function () {
     beforeEach(function () {
       delete OSM.home;
       delete OSM.location;
-      document.location.hash = "";
+      location.hash = "";
       document.cookie = "_osm_location=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
 
       // Test with another cookie set.
@@ -83,7 +83,7 @@ describe("OSM", function () {
     });
 
     it("parses lat/lon/zoom from the hash", function () {
-      document.location.hash = "#map=16/57.6247/-3.6845";
+      location.hash = "#map=16/57.6247/-3.6845";
       const params = OSM.mapParams("?");
       expect(params).to.have.property("lat", 57.6247);
       expect(params).to.have.property("lon", -3.6845);
@@ -133,7 +133,7 @@ describe("OSM", function () {
       params = OSM.mapParams("?");
       expect(params).to.have.property("layers", "C");
 
-      document.location.hash = "#map=5/57.6247/-3.6845&layers=M";
+      location.hash = "#map=5/57.6247/-3.6845&layers=M";
       params = OSM.mapParams("?");
       expect(params).to.have.property("layers", "M");
     });