• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

digitaltom / mapforge / 13000286915

27 Jan 2025 11:22PM UTC coverage: 99.522% (+0.006%) from 99.516%
13000286915

push

github

digitaltom
first version of privacy policy

2 of 2 new or added lines in 2 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

416 of 418 relevant lines covered (99.52%)

90.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.12
/app/controllers/maps_controller.rb
1
class MapsController < ApplicationController
4✔
2
  before_action :set_global_js_values, only: %i[show]
4✔
3
  before_action :set_map, only: %i[show properties]
4✔
4
  before_action :require_login, only: %i[my]
4✔
5

6
  layout "map", only: [ :show ]
4✔
7

8
  def index
4✔
9
    @maps = Map.where.not(private: true).includes(:layers).order(updated_at: :desc)
4✔
10
  end
11

12
  def my
4✔
13
    @maps = Map.where(user: @user).includes(:layers).order(updated_at: :desc)
1✔
14
  end
15

16
  def show
4✔
17
    @map_properties = @map.properties
104✔
18
    gon.map_id = params[:id]
104✔
19
    gon.map_mode = (params[:id] == @map.id.to_s) ? "rw" : "ro"
104✔
20
    gon.map_mode = "static" if params["static"]
104✔
21
    @map_mode = gon.map_mode
104✔
22
    gon.csrf_token = form_authenticity_token
104✔
23
    gon.map_properties = @map_properties
104✔
24

25
    respond_to do |format|
104✔
26
      format.html do
104✔
27
        case params["engine"]
51✔
28
        when "deck"
29
          render "deck"
1✔
30
        else
31
          render "maplibre"
50✔
32
        end
33
      end
34
      format.json { render json: @map.to_json }
105✔
35
      format.geojson { render json: @map.to_geojson }
155✔
36
      format.gpx { send_data @map.to_gpx, filename: @map.public_id + ".gpx" }
105✔
37
    end
38
  end
39

40
  def create
4✔
41
    @map = Map.create!(map_params)
1✔
42
    @map.update(user: @user)
1✔
43

44
    redirect_to map_url(@map), notice: "Map was successfully created."
1✔
45
  end
46

47
  # :nocov:
48
  def properties
✔
UNCOV
49
    render json: @map.properties.as_json
×
50
  end
51
  # :nocov:
52

53
  # some maplibre style tries to load eg. /atm_11; catching those calls here
54
  # :nocov:
55
  def catchall
✔
UNCOV
56
    head :ok
×
57
  end
58
  # :nocov:
59

60
  private
4✔
61

62
  def set_global_js_values
4✔
63
    gon.map_keys = Map.provider_keys
104✔
64
  end
65

66
  # Use callbacks to share common setup or constraints between actions.
67
  def set_map
4✔
68
    @map = Map.find_by(public_id: params[:id]) || Map.find_by(id: params[:id])
104✔
69
    head :not_found unless @map
104✔
70
  end
71

72
  # Only allow a list of trusted parameters through.
73
  def map_params
4✔
74
    params.fetch(:map, {})
1✔
75
  end
76
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc