From: Andy Allan Date: Wed, 11 Apr 2018 01:54:04 +0000 (+0800) Subject: Merge branch 'master' into moderation X-Git-Tag: live~3590^2~11 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7dbf8d83369cb73929080c4ba23fdd7dcd0184df?hp=-c Merge branch 'master' into moderation --- 7dbf8d83369cb73929080c4ba23fdd7dcd0184df diff --combined Gemfile.lock index 02bb3e5fd,e4448fddc..d1a9a0dd2 --- a/Gemfile.lock +++ b/Gemfile.lock @@@ -2,7 -2,6 +2,7 @@@ GE remote: https://rubygems.org/ specs: SystemTimer (1.2.3) + aasm (4.1.0) actioncable (5.1.5) actionpack (= 5.1.5) nio4r (~> 2.0) @@@ -49,7 -48,7 +49,7 @@@ rake (>= 10.4, < 13.0) arel (8.0.0) ast (2.4.0) - autoprefixer-rails (8.0.0) + autoprefixer-rails (8.2.0) execjs bigdecimal (1.1.0) builder (3.2.3) @@@ -64,8 -63,6 +64,6 @@@ xpath (>= 2.0, < 4.0) climate_control (0.2.0) cliver (0.3.2) - cocaine (0.5.8) - climate_control (>= 0.0.3, < 1.0) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@@ -88,7 -85,7 +86,7 @@@ dalli (2.7.6) docile (1.1.5) dynamic_form (1.1.4) - erubi (1.7.0) + erubi (1.7.1) execjs (2.7.0) exifr (1.3.3) factory_bot (4.8.2) @@@ -100,7 -97,7 +98,7 @@@ multipart-post (>= 1.2, < 3) ffi (1.9.23) fspath (3.1.0) - geoip (1.6.3) + geoip (1.6.4) globalid (0.4.1) activesupport (>= 4.2.0) hashdiff (0.3.7) @@@ -109,8 -106,8 +107,8 @@@ http_accept_language (2.0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - i18n-js (3.0.4) - i18n (~> 0.6, >= 0.6.6) + i18n-js (3.0.5) + i18n (>= 0.6.6, < 2) image_optim (0.26.1) exifr (~> 1.2, >= 1.2.2) fspath (~> 3.0) @@@ -150,7 -147,7 +148,7 @@@ activesupport (>= 4.0) logstash-event (~> 1.2.0) request_store - loofah (2.2.0) + loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.0) @@@ -166,7 -163,7 +164,7 @@@ multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) - nio4r (2.2.0) + nio4r (2.3.0) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) nokogumbo (1.5.0) @@@ -211,14 -208,14 +209,14 @@@ multi_json (~> 1.12) omniauth-oauth2 (~> 1.4) openstreetmap-deadlock_retry (1.3.0) - paperclip (5.2.1) + paperclip (5.3.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) - cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) parallel (1.12.1) - parser (2.5.0.2) + parser (2.5.0.5) ast (~> 2.4.0) pg (0.21.0) poltergeist (1.17.0) @@@ -229,14 -226,14 +227,14 @@@ progress (3.4.0) psych (3.0.2) public_suffix (3.0.2) - puma (3.11.2) + puma (3.11.3) r2 (0.2.7) rack (2.0.4) rack-cors (1.0.2) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-test (0.8.2) + rack-test (0.8.3) rack (>= 1.0, < 3) rack-uri_sanitizer (0.0.2) rails (5.1.5) @@@ -258,8 -255,8 +256,8 @@@ rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) rails-i18n (4.0.2) i18n (~> 0.6) rails (>= 4.0) @@@ -270,21 -267,21 +268,21 @@@ rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (3.0.0) - rake (12.3.0) - rb-fsevent (0.10.2) + rake (12.3.1) + rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) record_tag_helper (1.0.0) actionview (~> 5.x) redcarpet (3.4.0) ref (2.0.0) - request_store (1.4.0) + request_store (1.4.1) rack (>= 1.4) rinku (2.0.4) - rotp (3.3.0) - rubocop (0.52.1) + rotp (3.3.1) + rubocop (0.54.0) parallel (~> 1.10) - parser (>= 2.4.0.2, < 3.0) + parser (>= 2.5) powerpack (~> 0.1) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) @@@ -293,11 -290,11 +291,11 @@@ ruby-progressbar (1.9.0) ruby_dep (1.5.0) safe_yaml (1.0.4) - sanitize (4.6.0) + sanitize (4.6.4) crass (~> 1.0.2) nokogiri (>= 1.4.4) nokogumbo (~> 1.4) - sass (3.5.5) + sass (3.5.6) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@@ -324,6 -321,8 +322,8 @@@ sprockets (>= 3.0.0) term-ansicolor (1.6.0) tins (~> 1.0) + terrapin (0.6.0) + climate_control (>= 0.0.3, < 1.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@@ -333,7 -332,7 +333,7 @@@ tins (1.16.3) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.6) + uglifier (4.1.8) execjs (>= 0.3.0, < 3) unicode-display_width (1.3.0) useragent (0.16.10) @@@ -355,7 -354,6 +355,7 @@@ PLATFORM DEPENDENCIES SystemTimer (>= 1.1.3) + aasm actionpack-page_caching annotate autoprefixer-rails diff --combined app/assets/stylesheets/common.scss index f2df4d191,0a5d9164e..50b38e7a3 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@@ -938,6 -938,10 +938,10 @@@ header .search_forms border-radius: 0 2px 2px 0; } + input.error { + background-color: rgba($red, 0.4); + } + select { /* this next line is to polyfill the vertical alignment of text within a select element, * which is different between firefox and chrome. */ @@@ -2818,59 -2822,3 +2822,59 @@@ input.richtext_title[type="text"] display: none; } } + +.read-reports { + background: #eee; + opacity: 0.7; +} + +.report-related-block { + display:inline-block; +} + +.report-block { + width:475px; + float:left; + margin-right:100px; +} + +.related-reports { + width: 280px; + float: right; + + ul { + padding-left: $lineheight; + margin-bottom: 0; + + li { + list-style: disc; + } + } +} + +.issue-comments { + width:475px; +} + +.issues-list { + td:nth-child(2) { + white-space: nowrap; + } +} + +.report-disclaimer { + background: #fff1f0; + color: #d85030; + border-color: rgba(216, 80, 48, 0.3); + padding: 10px 20px; + margin-bottom: $lineheight; + + ul { + padding-left: $lineheight; + margin-bottom: 0; + + li { + list-style: disc; + } + } +} diff --combined app/models/user.rb index c063b7c34,da3964142..2a0a5ab45 --- a/app/models/user.rb +++ b/app/models/user.rb @@@ -33,6 -33,7 +33,7 @@@ # image_use_gravatar :boolean default(FALSE), not null # image_content_type :string # auth_provider :string + # home_tile :integer # # Indexes # @@@ -41,6 -42,7 +42,7 @@@ # users_display_name_lower_idx (lower((display_name)::text)) # users_email_idx (email) UNIQUE # users_email_lower_idx (lower((email)::text)) + # users_home_idx (home_tile) # class User < ActiveRecord::Base @@@ -73,11 -75,6 +75,11 @@@ has_many :roles, :class_name => "UserRole" + has_many :issues, :class_name => "Issue", :foreign_key => :reported_user_id + has_many :issue_comments + + has_many :reports + scope :visible, -> { where(:status => %w[pending active confirmed]) } scope :active, -> { where(:status => %w[active confirmed]) } scope :identifiable, -> { where(:data_public => true) } @@@ -100,7 -97,8 +102,8 @@@ validates :email, :if => proc { |u| u.email_changed? }, :uniqueness => { :case_sensitive => false } validates :pass_crypt, :confirmation => true, :length => 8..255 - validates :home_lat, :home_lon, :allow_nil => true, :numericality => true + validates :home_lat, :allow_nil => true, :numericality => true, :inclusion => { :in => -90..90 } + validates :home_lon, :allow_nil => true, :numericality => true, :inclusion => { :in => -180..180 } validates :home_zoom, :allow_nil => true, :numericality => { :only_integer => true } validates :preferred_editor, :inclusion => Editors::ALL_EDITORS, :allow_nil => true validates :image, :attachment_content_type => { :content_type => %r{\Aimage/.*\Z} } @@@ -112,8 -110,13 +115,13 @@@ after_initialize :set_defaults before_save :encrypt_password + before_save :update_tile after_save :spam_check + def to_param + display_name + end + def self.authenticate(options) if options[:username] && options[:password] user = find_by("email = ? OR display_name = ?", options[:username], options[:username]) @@@ -186,14 -189,20 +194,20 @@@ end def preferred_languages - @locales ||= Locale.list(languages) + @preferred_languages ||= Locale.list(languages) end def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS) if home_lon && home_lat gc = OSM::GreatCircle.new(home_lat, home_lon) + sql_for_area = QuadTile.sql_for_area(gc.bounds(radius), "home_") sql_for_distance = gc.sql_for_distance("home_lat", "home_lon") - nearby = User.where("id != ? AND status IN (\'active\', \'confirmed\') AND data_public = ? AND #{sql_for_distance} <= ?", id, true, radius).order(sql_for_distance).limit(num) + nearby = User.active.identifiable + .where("id != ?", id) + .where(sql_for_area) + .where("#{sql_for_distance} <= ?", radius) + .order(sql_for_distance) + .limit(num) else nearby = [] end @@@ -303,4 -312,8 +317,8 @@@ self.pass_crypt_confirmation = nil end end + + def update_tile + self.home_tile = QuadTile.tile_for_point(home_lat, home_lon) if home_lat && home_lon + end end diff --combined app/views/diary_entry/_diary_comment.html.erb index 708bdd49d,43f8cbbc1..8e17b0954 --- a/app/views/diary_entry/_diary_comment.html.erb +++ b/app/views/diary_entry/_diary_comment.html.erb @@@ -1,11 -1,6 +1,11 @@@
<%= user_thumbnail diary_comment.user %> -

<%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %> -

<%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %>

++

<%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %> + <% if current_user and diary_comment.user.id != current_user.id %> + | <%= report_link(t(".report"), diary_comment) %> + <% end %> +

+
<%= diary_comment.body.to_html %>
<%= if_administrator(:span) do %> <%= link_to t('diary_entry.diary_comment.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('diary_entry.diary_comment.confirm') } %> diff --combined app/views/diary_entry/_diary_entry.html.erb index d8ca41eaf,763915e46..ce311c168 --- a/app/views/diary_entry/_diary_entry.html.erb +++ b/app/views/diary_entry/_diary_entry.html.erb @@@ -7,7 -7,7 +7,7 @@@

<%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>

- <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %> + <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
@@@ -31,12 -31,6 +31,12 @@@ <%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %> <% end %> + <% if current_user and diary_entry.user != current_user %> +
  • + <%= report_link(t(".report"), diary_entry) %> +
  • + <% end %> + <%= if_administrator(:li) do %> <%= link_to t('diary_entry.diary_entry.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('diary_entry.diary_entry.confirm') } %> <% end %> diff --combined app/views/user/view.html.erb index b81d980a5,119fe10a4..f797c4ba4 --- a/app/views/user/view.html.erb +++ b/app/views/user/view.html.erb @@@ -102,11 -102,6 +102,11 @@@ <% end %> + <% if current_user and @this_user.id != current_user.id %> +
  • + <%= report_link(t(".report"), @this_user) %> +
  • + <% end %> <% end %> @@@ -200,7 -195,7 +200,7 @@@ <% nearby = @this_user.nearby - friends %>
    -

    <%= t 'user.view.your friends' %>

    +

    <%= t 'user.view.my friends' %>

    <% if friends.empty? %> <%= t 'user.view.no friends' %> diff --combined config/locales/en.yml index f5fe7c325,7df06b277..18ea59bf4 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@@ -207,7 -207,6 +207,7 @@@ en reopened_by: "Reactivated by %{user} %{when} ago" reopened_by_anonymous: "Reactivated by anonymous %{when} ago" hidden_by: "Hidden by %{user} %{when} ago" + report: Report this note query: title: "Query Features" introduction: "Click on the map to find nearby features." @@@ -231,7 -230,7 +231,7 @@@ list: title: "Changesets" title_user: "Changesets by %{user}" - title_friend: "Changesets by your friends" + title_friend: "Changesets by my friends" title_nearby: "Changesets by nearby users" empty: "No changesets found." empty_area: "No changesets in this area." @@@ -260,7 -259,7 +260,7 @@@ user_title: "%{user}'s diary" in_language_title: "Diary Entries in %{language}" new: New Diary Entry - new_title: Compose a new entry in your user diary + new_title: Compose a new entry in my user diary no_entries: No diary entries recent_entries: "Recent diary entries" older_entries: Older Entries @@@ -298,12 -297,10 +298,12 @@@ edit_link: Edit this entry hide_link: Hide this entry confirm: Confirm + report: Report this entry diary_comment: comment_from: "Comment from %{link_user} on %{comment_created_at}" hide_link: Hide this comment confirm: Confirm + report: Report this comment location: location: "Location:" view: "View" @@@ -962,106 -959,6 +962,106 @@@ results: no_results: "No results found" more_results: "More results" + issues: + report: Report + resolve: Resolve + ignore: Ignore + reopen: Reopen + index: + title: Issues + select_status: Select Status + select_type: Select Type + select_last_updated_by: Select Last Updated By + reported_user: Reported User + not_updated: Not Updated + search: Search + search_guidance: "Search Issues:" + user_not_found: User does not exist + issues_not_found: No such issues found + status: Status + reports: Reports + last_updated: Last Updated + last_updated_time_html: "%{time} ago" + last_updated_time_user_html: "%{time} ago by %{user}" + link_to_reports: View Reports + reported_user: Reported User + reports_count: + one: "1 Report" + other: "%{count} Reports" + reported_item: Reported Item + create: + successful_report: Your report has been registered sucessfully + provide_details: Please provide the required details + update: + new_report: Your report has been registered sucessfully + successful_update: Your report has been updated successfully + provide_details: Please provide the required details + new: + details: Please provide some more details about the problem (required). + select: "Select a reason for your report:" + disclaimer: + intro: "Before sending your report to the site moderators, please ensure that:" + not_just_mistake: You are certain that the problem is not just a mistake + unable_to_fix: You are unable to fix the problem yourself or with the help of your fellow community members + resolve_with_user: You have already tried to resolve the problem with the user concerned + show: + title: "%{status} Issue #%{issue_id}" + reports: + zero: No reports + one: 1 report + other: "%{count} reports" + report_created_at: "First reported at %{datetime}" + last_resolved_at: "Last resolved at %{datetime}" + last_updated_at: "Last updated at %{datetime} by %{displayname}" + reports_of_this_issue: Reports of this Issue + read_reports: Read Reports + new_reports: New Reports + other_issues_against_this_user: Other issues against this user + no_other_issues: No other issues against this user. + comments_on_this_issue: Comments on this issue + comments: + reassign_param: Reassign Issue? + comment: + provide_details: Please provide the required details + comment_created: Your comment was successfully created + comments: + created_at: "On %{datetime}" + reports: + updated_at: "On %{datetime}" + reported_by_html: "Reported as %{category} by %{user}" + resolved: Issue status has been set to 'Resolved' + ignored: Issue status has been set to 'Ignored' + reopened: Issue status has been set to 'Open' + states: + ignored: Ignored + open: Open + resolved: Resolved + reports: + new: + title_html: "Report %{link}" + missing_params: "Cannot create a new report" + categories: + diary_entry: + spam: This diary entry is/contains spam + offensive: This diary entry is obscene/offensive + threat: This diary entry contains a threat + other: Other + diary_comment: + spam: This diary comment is/contains spam + offensive: This diary comment is obscene/offensive + threat: This diary comment contains a threat + other: Other + user: + spam: This user profile is/contains spam + offensive: This user profile is obscene/offensive + threat: This user profile contains a threat + vandal: This user is a vandal + other: Other + note: + spam: This note is spam + personal: This note contains personal data + abusive: This note is abusive + other: Other layouts: project_name: # in @@@ -1080,7 -977,6 +1080,7 @@@ edit: Edit history: History export: Export + issues: Issues data: Data export_data: Export Data gps_traces: GPS Traces @@@ -1388,7 -1284,7 +1388,7 @@@ Acceptable Use Policies</a> and our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a> <br> Please <a href='https://osmfoundation.org/Contact'>contact the OSMF</a> - if you have licensing, copyright or other legal questions and issues. + if you have licensing, copyright or other legal questions. <br> OpenStreetMap, the magnifying glass logo and State of the Map are <a href="https://wiki.osmfoundation.org/wiki/Trademark_Policy">registered trademarks of the OSMF</a>. partners_title: Partners @@@ -1715,7 -1611,7 +1715,7 @@@ trace_header: upload_trace: "Upload a trace" see_all_traces: "See all traces" - see_your_traces: "See your traces" + see_my_traces: "See my traces" traces_waiting: one: "You have %{count} trace waiting for upload. Please consider waiting for these to finish before uploading any more, so as not to block the queue for other users." other: "You have %{count} traces waiting for upload. Please consider waiting for these to finish before uploading any more, so as not to block the queue for other users." @@@ -1740,6 -1636,7 +1740,7 @@@ delete_track: "Delete this trace" trace_not_found: "Trace not found!" visibility: "Visibility:" + confirm_delete: "Delete this trace?" trace_paging_nav: showing_page: "Page %{page}" older: "Older Traces" @@@ -1762,7 -1659,7 +1763,7 @@@ map: "map" list: public_traces: "Public GPS traces" - your_traces: "Your GPS traces" + my_traces: "My GPS traces" public_traces_from: "Public GPS traces from %{user}" description: "Browse recent GPS trace uploads" tagged_with: " tagged with %{tags}" @@@ -1786,12 -1683,8 +1787,12 @@@ application: require_cookies: cookies_needed: "You appear to have cookies disabled - please enable cookies in your browser before continuing." + require_admin: + not_an_admin: You need to be an admin to perform that action. require_moderator: not_a_moderator: "You need to be a moderator to perform that action." + require_moderator_or_admin: + not_a_moderator_or_admin: You need to be a moderator or an admin to perform that action setup_user_auth: blocked_zero_hour: "You have an urgent message on the OpenStreetMap web site. You need to read the message before you will be able to save your edits." blocked: "Your access to the API has been blocked. Please log-in to the web interface to find out more." @@@ -2031,7 -1924,7 +2032,7 @@@ user location: User location if set location: "Set your home location on the %{settings_link} page to see nearby users." settings_link_text: settings - your friends: Your friends + my friends: My friends no friends: You have not added any friends yet. km away: "%{count}km away" m away: "%{count}m away" @@@ -2061,7 -1954,6 +2062,7 @@@ friends_diaries: "friends' diary entries" nearby_changesets: "nearby user changesets" nearby_diaries: "nearby user diary entries" + report: Report this User popup: your location: "Your location" nearby mapper: "Nearby mapper" @@@ -2434,7 -2326,7 +2435,7 @@@ distance: "Distance" errors: no_route: "Couldn't find a route between those two places." - no_place: "Sorry - couldn't find that place." + no_place: "Sorry - couldn't locate '%{place}'." instructions: continue_without_exit: Continue on %{name} slight_right_without_exit: Slight right onto %{name} @@@ -2450,6 -2342,7 +2451,7 @@@ onramp_right_with_directions: Turn right onto the ramp towards %{directions} onramp_right_with_name_directions: Turn right on the ramp onto %{name}, towards %{directions} onramp_right_without_directions: Turn right onto the ramp + onramp_right: Turn right onto the ramp endofroad_right_without_exit: At the end of the road turn right onto %{name} merge_right_without_exit: Merge right onto %{name} fork_right_without_exit: At the fork turn right onto %{name} @@@ -2470,6 -2363,7 +2472,7 @@@ onramp_left_with_directions: Turn left onto the ramp towards %{directions} onramp_left_with_name_directions: Turn left on the ramp onto %{name}, towards %{directions} onramp_left_without_directions: Turn left onto the ramp + onramp_left: Turn left onto the ramp endofroad_left_without_exit: At the end of the road turn left onto %{name} merge_left_without_exit: Merge left onto %{name} fork_left_without_exit: At the fork turn left onto %{name} diff --combined config/routes.rb index 8160c878c,1016a89de..0c250b0cc --- a/config/routes.rb +++ b/config/routes.rb @@@ -1,91 -1,92 +1,92 @@@ OpenStreetMap::Application.routes.draw do # API - match "api/capabilities" => "api#capabilities", :via => :get - match "api/0.6/capabilities" => "api#capabilities", :via => :get - match "api/0.6/permissions" => "api#permissions", :via => :get - - match "api/0.6/changeset/create" => "changeset#create", :via => :put - match "api/0.6/changeset/:id/upload" => "changeset#upload", :via => :post, :id => /\d+/ - match "api/0.6/changeset/:id/download" => "changeset#download", :via => :get, :as => :changeset_download, :id => /\d+/ - match "api/0.6/changeset/:id/expand_bbox" => "changeset#expand_bbox", :via => :post, :id => /\d+/ - match "api/0.6/changeset/:id" => "changeset#read", :via => :get, :as => :changeset_read, :id => /\d+/ - match "api/0.6/changeset/:id/subscribe" => "changeset#subscribe", :via => :post, :as => :changeset_subscribe, :id => /\d+/ - match "api/0.6/changeset/:id/unsubscribe" => "changeset#unsubscribe", :via => :post, :as => :changeset_unsubscribe, :id => /\d+/ - match "api/0.6/changeset/:id" => "changeset#update", :via => :put, :id => /\d+/ - match "api/0.6/changeset/:id/close" => "changeset#close", :via => :put, :id => /\d+/ - match "api/0.6/changesets" => "changeset#query", :via => :get - post "api/0.6/changeset/:id/comment" => "changeset#comment", :as => :changeset_comment, :id => /\d+/ - post "api/0.6/changeset/comment/:id/hide" => "changeset#hide_comment", :as => :changeset_comment_hide, :id => /\d+/ - post "api/0.6/changeset/comment/:id/unhide" => "changeset#unhide_comment", :as => :changeset_comment_unhide, :id => /\d+/ - - match "api/0.6/node/create" => "node#create", :via => :put - match "api/0.6/node/:id/ways" => "way#ways_for_node", :via => :get, :id => /\d+/ - match "api/0.6/node/:id/relations" => "relation#relations_for_node", :via => :get, :id => /\d+/ - match "api/0.6/node/:id/history" => "old_node#history", :via => :get, :id => /\d+/ - match "api/0.6/node/:id/:version/redact" => "old_node#redact", :via => :post, :version => /\d+/, :id => /\d+/ - match "api/0.6/node/:id/:version" => "old_node#version", :via => :get, :id => /\d+/, :version => /\d+/ - match "api/0.6/node/:id" => "node#read", :via => :get, :id => /\d+/ - match "api/0.6/node/:id" => "node#update", :via => :put, :id => /\d+/ - match "api/0.6/node/:id" => "node#delete", :via => :delete, :id => /\d+/ - match "api/0.6/nodes" => "node#nodes", :via => :get - - match "api/0.6/way/create" => "way#create", :via => :put - match "api/0.6/way/:id/history" => "old_way#history", :via => :get, :id => /\d+/ - match "api/0.6/way/:id/full" => "way#full", :via => :get, :id => /\d+/ - match "api/0.6/way/:id/relations" => "relation#relations_for_way", :via => :get, :id => /\d+/ - match "api/0.6/way/:id/:version/redact" => "old_way#redact", :via => :post, :version => /\d+/, :id => /\d+/ - match "api/0.6/way/:id/:version" => "old_way#version", :via => :get, :id => /\d+/, :version => /\d+/ - match "api/0.6/way/:id" => "way#read", :via => :get, :id => /\d+/ - match "api/0.6/way/:id" => "way#update", :via => :put, :id => /\d+/ - match "api/0.6/way/:id" => "way#delete", :via => :delete, :id => /\d+/ - match "api/0.6/ways" => "way#ways", :via => :get - - match "api/0.6/relation/create" => "relation#create", :via => :put - match "api/0.6/relation/:id/relations" => "relation#relations_for_relation", :via => :get, :id => /\d+/ - match "api/0.6/relation/:id/history" => "old_relation#history", :via => :get, :id => /\d+/ - match "api/0.6/relation/:id/full" => "relation#full", :via => :get, :id => /\d+/ - match "api/0.6/relation/:id/:version/redact" => "old_relation#redact", :via => :post, :version => /\d+/, :id => /\d+/ - match "api/0.6/relation/:id/:version" => "old_relation#version", :via => :get, :id => /\d+/, :version => /\d+/ - match "api/0.6/relation/:id" => "relation#read", :via => :get, :id => /\d+/ - match "api/0.6/relation/:id" => "relation#update", :via => :put, :id => /\d+/ - match "api/0.6/relation/:id" => "relation#delete", :via => :delete, :id => /\d+/ - match "api/0.6/relations" => "relation#relations", :via => :get - - match "api/0.6/map" => "api#map", :via => :get - - match "api/0.6/trackpoints" => "api#trackpoints", :via => :get - - match "api/0.6/changes" => "api#changes", :via => :get - - match "api/0.6/search" => "search#search_all", :via => :get - match "api/0.6/ways/search" => "search#search_ways", :via => :get - match "api/0.6/relations/search" => "search#search_relations", :via => :get - match "api/0.6/nodes/search" => "search#search_nodes", :via => :get - - match "api/0.6/user/:id" => "user#api_read", :via => :get, :id => /\d+/ - match "api/0.6/user/details" => "user#api_details", :via => :get - match "api/0.6/user/gpx_files" => "user#api_gpx_files", :via => :get - - match "api/0.6/user/preferences" => "user_preference#read", :via => :get - match "api/0.6/user/preferences/:preference_key" => "user_preference#read_one", :via => :get - match "api/0.6/user/preferences" => "user_preference#update", :via => :put - match "api/0.6/user/preferences/:preference_key" => "user_preference#update_one", :via => :put - match "api/0.6/user/preferences/:preference_key" => "user_preference#delete_one", :via => :delete - - match "api/0.6/gpx/create" => "trace#api_create", :via => :post - match "api/0.6/gpx/:id" => "trace#api_read", :via => :get, :id => /\d+/ - match "api/0.6/gpx/:id" => "trace#api_update", :via => :put, :id => /\d+/ - match "api/0.6/gpx/:id" => "trace#api_delete", :via => :delete, :id => /\d+/ - match "api/0.6/gpx/:id/details" => "trace#api_read", :via => :get, :id => /\d+/ - match "api/0.6/gpx/:id/data" => "trace#api_data", :via => :get - - # AMF (ActionScript) API - match "api/0.6/amf/read" => "amf#amf_read", :via => :post - match "api/0.6/amf/write" => "amf#amf_write", :via => :post - match "api/0.6/swf/trackpoints" => "swf#trackpoints", :via => :get - - # Map notes API + get "api/capabilities" => "api#capabilities" + scope "api/0.6" do + get "capabilities" => "api#capabilities" + get "permissions" => "api#permissions" + + put "changeset/create" => "changeset#create" + post "changeset/:id/upload" => "changeset#upload", :id => /\d+/ + get "changeset/:id/download" => "changeset#download", :as => :changeset_download, :id => /\d+/ + post "changeset/:id/expand_bbox" => "changeset#expand_bbox", :id => /\d+/ + get "changeset/:id" => "changeset#read", :as => :changeset_read, :id => /\d+/ + post "changeset/:id/subscribe" => "changeset#subscribe", :as => :changeset_subscribe, :id => /\d+/ + post "changeset/:id/unsubscribe" => "changeset#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/ + put "changeset/:id" => "changeset#update", :id => /\d+/ + put "changeset/:id/close" => "changeset#close", :id => /\d+/ + get "changesets" => "changeset#query" + post "changeset/:id/comment" => "changeset#comment", :as => :changeset_comment, :id => /\d+/ + post "changeset/comment/:id/hide" => "changeset#hide_comment", :as => :changeset_comment_hide, :id => /\d+/ + post "changeset/comment/:id/unhide" => "changeset#unhide_comment", :as => :changeset_comment_unhide, :id => /\d+/ + + put "node/create" => "node#create" + get "node/:id/ways" => "way#ways_for_node", :id => /\d+/ + get "node/:id/relations" => "relation#relations_for_node", :id => /\d+/ + get "node/:id/history" => "old_node#history", :id => /\d+/ + post "node/:id/:version/redact" => "old_node#redact", :version => /\d+/, :id => /\d+/ + get "node/:id/:version" => "old_node#version", :id => /\d+/, :version => /\d+/ + get "node/:id" => "node#read", :id => /\d+/ + put "node/:id" => "node#update", :id => /\d+/ + delete "node/:id" => "node#delete", :id => /\d+/ + get "nodes" => "node#nodes" + + put "way/create" => "way#create" + get "way/:id/history" => "old_way#history", :id => /\d+/ + get "way/:id/full" => "way#full", :id => /\d+/ + get "way/:id/relations" => "relation#relations_for_way", :id => /\d+/ + post "way/:id/:version/redact" => "old_way#redact", :version => /\d+/, :id => /\d+/ + get "way/:id/:version" => "old_way#version", :id => /\d+/, :version => /\d+/ + get "way/:id" => "way#read", :id => /\d+/ + put "way/:id" => "way#update", :id => /\d+/ + delete "way/:id" => "way#delete", :id => /\d+/ + get "ways" => "way#ways" + + put "relation/create" => "relation#create" + get "relation/:id/relations" => "relation#relations_for_relation", :id => /\d+/ + get "relation/:id/history" => "old_relation#history", :id => /\d+/ + get "relation/:id/full" => "relation#full", :id => /\d+/ + post "relation/:id/:version/redact" => "old_relation#redact", :version => /\d+/, :id => /\d+/ + get "relation/:id/:version" => "old_relation#version", :id => /\d+/, :version => /\d+/ + get "relation/:id" => "relation#read", :id => /\d+/ + put "relation/:id" => "relation#update", :id => /\d+/ + delete "relation/:id" => "relation#delete", :id => /\d+/ + get "relations" => "relation#relations" + + get "map" => "api#map" + + get "trackpoints" => "api#trackpoints" + + get "changes" => "api#changes" + + get "search" => "search#search_all", :as => "api_search" + get "ways/search" => "search#search_ways" + get "relations/search" => "search#search_relations" + get "nodes/search" => "search#search_nodes" + + get "user/:id" => "user#api_read", :id => /\d+/ + get "user/details" => "user#api_details" + get "user/gpx_files" => "user#api_gpx_files" + + get "user/preferences" => "user_preference#read" + get "user/preferences/:preference_key" => "user_preference#read_one" + put "user/preferences" => "user_preference#update" + put "user/preferences/:preference_key" => "user_preference#update_one" + delete "user/preferences/:preference_key" => "user_preference#delete_one" + + post "gpx/create" => "trace#api_create" + get "gpx/:id" => "trace#api_read", :id => /\d+/ + put "gpx/:id" => "trace#api_update", :id => /\d+/ + delete "gpx/:id" => "trace#api_delete", :id => /\d+/ + get "gpx/:id/details" => "trace#api_read", :id => /\d+/ + get "gpx/:id/data" => "trace#api_data" + + # AMF (ActionScript) API + post "amf/read" => "amf#amf_read" + post "amf/write" => "amf#amf_write" + get "swf/trackpoints" => "swf#trackpoints" + + # Map notes API resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" } do collection do get "search" @@@ -99,29 -100,29 +100,29 @@@ end end - match "notes/addPOIexec" => "notes#create", :via => :post - match "notes/closePOIexec" => "notes#close", :via => :post - match "notes/editPOIexec" => "notes#comment", :via => :post - match "notes/getGPX" => "notes#index", :via => :get, :format => "gpx" - match "notes/getRSSfeed" => "notes#feed", :via => :get, :format => "rss" + post "notes/addPOIexec" => "notes#create" + post "notes/closePOIexec" => "notes#close" + post "notes/editPOIexec" => "notes#comment" + get "notes/getGPX" => "notes#index", :format => "gpx" + get "notes/getRSSfeed" => "notes#feed", :format => "rss" end # Data browsing - match "/way/:id" => "browse#way", :via => :get, :id => /\d+/, :as => :way - match "/way/:id/history" => "browse#way_history", :via => :get, :id => /\d+/ - match "/node/:id" => "browse#node", :via => :get, :id => /\d+/, :as => :node - match "/node/:id/history" => "browse#node_history", :via => :get, :id => /\d+/ - match "/relation/:id" => "browse#relation", :via => :get, :id => /\d+/, :as => :relation - match "/relation/:id/history" => "browse#relation_history", :via => :get, :id => /\d+/ - match "/changeset/:id" => "browse#changeset", :via => :get, :as => :changeset, :id => /\d+/ - match "/changeset/:id/comments/feed" => "changeset#comments_feed", :via => :get, :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" } - match "/note/:id" => "browse#note", :via => :get, :id => /\d+/, :as => "browse_note" - match "/note/new" => "browse#new_note", :via => :get - match "/user/:display_name/history" => "changeset#list", :via => :get - match "/user/:display_name/history/feed" => "changeset#feed", :via => :get, :defaults => { :format => :atom } - match "/user/:display_name/notes" => "notes#mine", :via => :get - match "/history/friends" => "changeset#list", :via => :get, :friends => true, :as => "friend_changesets", :defaults => { :format => :html } - match "/history/nearby" => "changeset#list", :via => :get, :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html } + get "/way/:id" => "browse#way", :id => /\d+/, :as => :way + get "/way/:id/history" => "browse#way_history", :id => /\d+/ + get "/node/:id" => "browse#node", :id => /\d+/, :as => :node + get "/node/:id/history" => "browse#node_history", :id => /\d+/ + get "/relation/:id" => "browse#relation", :id => /\d+/, :as => :relation + get "/relation/:id/history" => "browse#relation_history", :id => /\d+/ + get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/ + get "/changeset/:id/comments/feed" => "changeset#comments_feed", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" } + get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note" + get "/note/new" => "browse#new_note" + get "/user/:display_name/history" => "changeset#list" + get "/user/:display_name/history/feed" => "changeset#feed", :defaults => { :format => :atom } + get "/user/:display_name/notes" => "notes#mine" + get "/history/friends" => "changeset#list", :friends => true, :as => "friend_changesets", :defaults => { :format => :html } + get "/history/nearby" => "changeset#list", :nearby => true, :as => "nearby_changesets", :defaults => { :format => :html } get "/browse/way/:id", :to => redirect(:path => "/way/%{id}") get "/browse/way/:id/history", :to => redirect(:path => "/way/%{id}/history") @@@ -141,132 -142,132 +142,132 @@@ # web site root :to => "site#index", :via => [:get, :post] - match "/edit" => "site#edit", :via => :get, :as => :edit - match "/copyright/:copyright_locale" => "site#copyright", :via => :get - match "/copyright" => "site#copyright", :via => :get - match "/welcome" => "site#welcome", :via => :get, :as => :welcome - match "/fixthemap" => "site#fixthemap", :via => :get, :as => :fixthemap - match "/help" => "site#help", :via => :get, :as => :help - match "/about" => "site#about", :via => :get, :as => :about - match "/history" => "changeset#list", :via => :get - match "/history/feed" => "changeset#feed", :via => :get, :defaults => { :format => :atom } - match "/history/comments/feed" => "changeset#comments_feed", :via => :get, :as => :changesets_comments_feed, :defaults => { :format => "rss" } - match "/export" => "site#export", :via => :get + get "/edit" => "site#edit" + get "/copyright/:copyright_locale" => "site#copyright" + get "/copyright" => "site#copyright" + get "/welcome" => "site#welcome" + get "/fixthemap" => "site#fixthemap" + get "/help" => "site#help" + get "/about" => "site#about" + get "/history" => "changeset#list" + get "/history/feed" => "changeset#feed", :defaults => { :format => :atom } + get "/history/comments/feed" => "changeset#comments_feed", :as => :changesets_comments_feed, :defaults => { :format => "rss" } + get "/export" => "site#export" match "/login" => "user#login", :via => [:get, :post] match "/logout" => "user#logout", :via => [:get, :post] - match "/offline" => "site#offline", :via => :get - match "/key" => "site#key", :via => :get - match "/id" => "site#id", :via => :get - match "/query" => "browse#query", :via => :get - match "/user/new" => "user#new", :via => :get - match "/user/new" => "user#create", :via => :post - match "/user/terms" => "user#terms", :via => :get - match "/user/save" => "user#save", :via => :post - match "/user/:display_name/confirm/resend" => "user#confirm_resend", :via => :get + get "/offline" => "site#offline" + get "/key" => "site#key" + get "/id" => "site#id" + get "/query" => "browse#query" + get "/user/new" => "user#new" + post "/user/new" => "user#create" + get "/user/terms" => "user#terms" + post "/user/save" => "user#save" + get "/user/:display_name/confirm/resend" => "user#confirm_resend" match "/user/:display_name/confirm" => "user#confirm", :via => [:get, :post] match "/user/confirm" => "user#confirm", :via => [:get, :post] match "/user/confirm-email" => "user#confirm_email", :via => [:get, :post] - match "/user/go_public" => "user#go_public", :via => :post + post "/user/go_public" => "user#go_public" match "/user/reset-password" => "user#reset_password", :via => [:get, :post] match "/user/forgot-password" => "user#lost_password", :via => [:get, :post] - match "/user/suspended" => "user#suspended", :via => :get + get "/user/suspended" => "user#suspended" get "/index.html", :to => redirect(:path => "/") get "/create-account.html", :to => redirect(:path => "/user/new") get "/forgot-password.html", :to => redirect(:path => "/user/forgot-password") # omniauth - match "/auth/failure" => "user#auth_failure", :via => :get + get "/auth/failure" => "user#auth_failure" match "/auth/:provider/callback" => "user#auth_success", :via => [:get, :post], :as => :auth_success match "/auth/:provider" => "user#auth", :via => [:get, :post], :as => :auth # permalink - match "/go/:code" => "site#permalink", :via => :get, :code => /[a-zA-Z0-9_@~]+[=-]*/ + get "/go/:code" => "site#permalink", :code => /[a-zA-Z0-9_@~]+[=-]*/ # rich text preview - match "/preview/:type" => "site#preview", :via => :post, :as => :preview + post "/preview/:type" => "site#preview", :as => :preview # traces - match "/user/:display_name/traces/tag/:tag/page/:page" => "trace#list", :via => :get, :page => /[1-9][0-9]*/ - match "/user/:display_name/traces/tag/:tag" => "trace#list", :via => :get - match "/user/:display_name/traces/page/:page" => "trace#list", :via => :get, :page => /[1-9][0-9]*/ - match "/user/:display_name/traces" => "trace#list", :via => :get - match "/user/:display_name/traces/tag/:tag/rss" => "trace#georss", :via => :get, :defaults => { :format => :rss } - match "/user/:display_name/traces/rss" => "trace#georss", :via => :get, :defaults => { :format => :rss } - match "/user/:display_name/traces/:id" => "trace#view", :via => :get - match "/user/:display_name/traces/:id/picture" => "trace#picture", :via => :get - match "/user/:display_name/traces/:id/icon" => "trace#icon", :via => :get - match "/traces/tag/:tag/page/:page" => "trace#list", :via => :get, :page => /[1-9][0-9]*/ - match "/traces/tag/:tag" => "trace#list", :via => :get - match "/traces/page/:page" => "trace#list", :via => :get, :page => /[1-9][0-9]*/ - match "/traces" => "trace#list", :via => :get - match "/traces/tag/:tag/rss" => "trace#georss", :via => :get, :defaults => { :format => :rss } - match "/traces/rss" => "trace#georss", :via => :get, :defaults => { :format => :rss } - match "/traces/mine/tag/:tag/page/:page" => "trace#mine", :via => :get, :page => /[1-9][0-9]*/ - match "/traces/mine/tag/:tag" => "trace#mine", :via => :get - match "/traces/mine/page/:page" => "trace#mine", :via => :get - match "/traces/mine" => "trace#mine", :via => :get + get "/user/:display_name/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/ + get "/user/:display_name/traces/tag/:tag" => "trace#list" + get "/user/:display_name/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/ + get "/user/:display_name/traces" => "trace#list" + get "/user/:display_name/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss } + get "/user/:display_name/traces/rss" => "trace#georss", :defaults => { :format => :rss } + get "/user/:display_name/traces/:id" => "trace#view" + get "/user/:display_name/traces/:id/picture" => "trace#picture" + get "/user/:display_name/traces/:id/icon" => "trace#icon" + get "/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/ + get "/traces/tag/:tag" => "trace#list" + get "/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/ + get "/traces" => "trace#list" + get "/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss } + get "/traces/rss" => "trace#georss", :defaults => { :format => :rss } + get "/traces/mine/tag/:tag/page/:page" => "trace#mine", :page => /[1-9][0-9]*/ + get "/traces/mine/tag/:tag" => "trace#mine" + get "/traces/mine/page/:page" => "trace#mine" + get "/traces/mine" => "trace#mine" match "/trace/create" => "trace#create", :via => [:get, :post] - match "/trace/:id/data" => "trace#data", :via => :get, :id => /\d+/, :as => "trace_data" + get "/trace/:id/data" => "trace#data", :id => /\d+/, :as => "trace_data" match "/trace/:id/edit" => "trace#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit" - match "/trace/:id/delete" => "trace#delete", :via => :post, :id => /\d+/ + post "/trace/:id/delete" => "trace#delete", :id => /\d+/ # diary pages match "/diary/new" => "diary_entry#new", :via => [:get, :post] - match "/diary/friends" => "diary_entry#list", :friends => true, :via => :get, :as => "friend_diaries" - match "/diary/nearby" => "diary_entry#list", :nearby => true, :via => :get, :as => "nearby_diaries" - match "/user/:display_name/diary/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss } - match "/diary/:language/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss } - match "/diary/rss" => "diary_entry#rss", :via => :get, :defaults => { :format => :rss } - match "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :via => :get, :page => /[1-9][0-9]*/ - match "/user/:display_name/diary/comments/" => "diary_entry#comments", :via => :get - match "/user/:display_name/diary" => "diary_entry#list", :via => :get - match "/diary/:language" => "diary_entry#list", :via => :get - match "/diary" => "diary_entry#list", :via => :get - match "/user/:display_name/diary/:id" => "diary_entry#view", :via => :get, :id => /\d+/, :as => :diary_entry - match "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :via => :post, :id => /\d+/ + get "/diary/friends" => "diary_entry#list", :friends => true, :as => "friend_diaries" + get "/diary/nearby" => "diary_entry#list", :nearby => true, :as => "nearby_diaries" + get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss } + get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss } + get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss } + get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/ + get "/user/:display_name/diary/comments/" => "diary_entry#comments" + get "/user/:display_name/diary" => "diary_entry#list" + get "/diary/:language" => "diary_entry#list" + get "/diary" => "diary_entry#list" - get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/ ++ get "/user/:display_name/diary/:id" => "diary_entry#view", :id => /\d+/, :as => :diary_entry + post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/ match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/ - match "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :via => :post, :id => /\d+/, :as => :hide_diary_entry - match "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :via => :post, :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment - match "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :via => :post, :as => :diary_entry_subscribe, :id => /\d+/ - match "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :via => :post, :as => :diary_entry_unsubscribe, :id => /\d+/ + post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry + post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment + post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/ + post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/ # user pages - match "/user/:display_name" => "user#view", :via => :get, :as => "user" + get "/user/:display_name" => "user#view", :as => "user" match "/user/:display_name/make_friend" => "user#make_friend", :via => [:get, :post], :as => "make_friend" match "/user/:display_name/remove_friend" => "user#remove_friend", :via => [:get, :post], :as => "remove_friend" match "/user/:display_name/account" => "user#account", :via => [:get, :post] - match "/user/:display_name/set_status" => "user#set_status", :via => :get, :as => :set_status_user - match "/user/:display_name/delete" => "user#delete", :via => :get, :as => :delete_user + get "/user/:display_name/set_status" => "user#set_status", :as => :set_status_user + get "/user/:display_name/delete" => "user#delete", :as => :delete_user # user lists match "/users" => "user#list", :via => [:get, :post] match "/users/:status" => "user#list", :via => [:get, :post] # geocoder - match "/search" => "geocoder#search", :via => :get, :as => :search - match "/geocoder/search_latlon" => "geocoder#search_latlon", :via => :get - match "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode", :via => :get - match "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim", :via => :get - match "/geocoder/search_geonames" => "geocoder#search_geonames", :via => :get - match "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse", :via => :get - match "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse", :via => :get + get "/search" => "geocoder#search" + get "/geocoder/search_latlon" => "geocoder#search_latlon" + get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode" + get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim" + get "/geocoder/search_geonames" => "geocoder#search_geonames" + get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse" + get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse" # directions - match "/directions" => "directions#search", :via => :get, :as => :directions + get "/directions" => "directions#search" # export - match "/export/finish" => "export#finish", :via => :post - match "/export/embed" => "export#embed", :via => :get + post "/export/finish" => "export#finish" + get "/export/embed" => "export#embed" # messages - match "/user/:display_name/inbox" => "message#inbox", :via => :get, :as => "inbox" - match "/user/:display_name/outbox" => "message#outbox", :via => :get, :as => "outbox" + get "/user/:display_name/inbox" => "message#inbox", :as => "inbox" + get "/user/:display_name/outbox" => "message#outbox", :as => "outbox" match "/message/new/:display_name" => "message#new", :via => [:get, :post], :as => "new_message" - match "/message/read/:message_id" => "message#read", :via => :get, :as => "read_message" - match "/message/mark/:message_id" => "message#mark", :via => :post, :as => "mark_message" + get "/message/read/:message_id" => "message#read", :as => "read_message" + post "/message/mark/:message_id" => "message#mark", :as => "mark_message" match "/message/reply/:message_id" => "message#reply", :via => [:get, :post], :as => "reply_message" - match "/message/delete/:message_id" => "message#delete", :via => :post, :as => "delete_message" + post "/message/delete/:message_id" => "message#delete", :as => "delete_message" # oauth admin pages (i.e: for setting up new clients, etc...) scope "/user/:display_name" do @@@ -274,33 -275,20 +275,33 @@@ end match "/oauth/revoke" => "oauth#revoke", :via => [:get, :post] match "/oauth/authorize" => "oauth#authorize", :via => [:get, :post], :as => :authorize - match "/oauth/token" => "oauth#token", :via => :get, :as => :token + get "/oauth/token" => "oauth#token", :as => :token match "/oauth/request_token" => "oauth#request_token", :via => [:get, :post], :as => :request_token match "/oauth/access_token" => "oauth#access_token", :via => [:get, :post], :as => :access_token - match "/oauth/test_request" => "oauth#test_request", :via => :get, :as => :test_request + get "/oauth/test_request" => "oauth#test_request", :as => :test_request # roles and banning pages - match "/user/:display_name/role/:role/grant" => "user_roles#grant", :via => :post, :as => "grant_role" - match "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :via => :post, :as => "revoke_role" - match "/user/:display_name/blocks" => "user_blocks#blocks_on", :via => :get - match "/user/:display_name/blocks_by" => "user_blocks#blocks_by", :via => :get - match "/blocks/new/:display_name" => "user_blocks#new", :via => :get, :as => "new_user_block" + post "/user/:display_name/role/:role/grant" => "user_roles#grant", :as => "grant_role" + post "/user/:display_name/role/:role/revoke" => "user_roles#revoke", :as => "revoke_role" + get "/user/:display_name/blocks" => "user_blocks#blocks_on" + get "/user/:display_name/blocks_by" => "user_blocks#blocks_by" + get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block" resources :user_blocks match "/blocks/:id/revoke" => "user_blocks#revoke", :via => [:get, :post], :as => "revoke_user_block" + # issues and reports + resources :issues do + resources :comments, :controller => :issue_comments + member do + post "resolve" + post "assign" + post "ignore" + post "reopen" + end + end + + resources :reports + # redactions resources :redactions end diff --combined db/structure.sql index 73cb543e7,8803c0c02..077faffad --- a/db/structure.sql +++ b/db/structure.sql @@@ -1,12 -1,6 +1,6 @@@ - -- - -- PostgreSQL database dump - -- - - -- Dumped from database version 9.5.7 - -- Dumped by pg_dump version 9.5.7 - SET statement_timeout = 0; SET lock_timeout = 0; + SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; @@@ -66,17 -60,6 +60,17 @@@ CREATE TYPE gpx_visibility_enum AS ENU ); +-- +-- Name: issue_status_enum; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE issue_status_enum AS ENUM ( + 'open', + 'ignored', + 'resolved' +); + + -- -- Name: note_event_enum; Type: TYPE; Schema: public; Owner: - -- @@@ -696,78 -679,6 +690,78 @@@ CREATE SEQUENCE gpx_files_id_se ALTER SEQUENCE gpx_files_id_seq OWNED BY gpx_files.id; +-- +-- Name: issue_comments; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE issue_comments ( + id integer NOT NULL, + issue_id integer NOT NULL, + user_id integer NOT NULL, + body text NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +-- +-- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE issue_comments_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE issue_comments_id_seq OWNED BY issue_comments.id; + + +-- +-- Name: issues; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE issues ( + id integer NOT NULL, + reportable_type character varying NOT NULL, + reportable_id integer NOT NULL, + reported_user_id integer, + status issue_status_enum DEFAULT 'open'::public.issue_status_enum NOT NULL, + assigned_role user_role_enum NOT NULL, + resolved_at timestamp without time zone, + resolved_by integer, + updated_by integer, + reports_count integer DEFAULT 0, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +-- +-- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE issues_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE issues_id_seq OWNED BY issues.id; + + -- -- Name: languages; Type: TABLE; Schema: public; Owner: - -- @@@ -1069,40 -980,6 +1063,40 @@@ CREATE TABLE relations ); +-- +-- Name: reports; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE reports ( + id integer NOT NULL, + issue_id integer NOT NULL, + user_id integer NOT NULL, + details text NOT NULL, + category character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +-- +-- Name: reports_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE reports_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: reports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE reports_id_seq OWNED BY reports.id; + + -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- @@@ -1260,7 -1137,8 +1254,8 @@@ CREATE TABLE users diary_entries_count integer DEFAULT 0 NOT NULL, image_use_gravatar boolean DEFAULT false NOT NULL, image_content_type character varying(255), - auth_provider character varying + auth_provider character varying(255), + home_tile bigint ); @@@ -1322,182 -1200,161 +1317,182 @@@ CREATE TABLE ways -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: acls id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY acls ALTER COLUMN id SET DEFAULT nextval('acls_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: changeset_comments id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY changeset_comments ALTER COLUMN id SET DEFAULT nextval('changeset_comments_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: changesets id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY changesets ALTER COLUMN id SET DEFAULT nextval('changesets_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: client_applications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY client_applications ALTER COLUMN id SET DEFAULT nextval('client_applications_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: current_nodes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY current_nodes ALTER COLUMN id SET DEFAULT nextval('current_nodes_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: current_relations id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relations ALTER COLUMN id SET DEFAULT nextval('current_relations_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: current_ways id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY current_ways ALTER COLUMN id SET DEFAULT nextval('current_ways_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: diary_comments id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_comments ALTER COLUMN id SET DEFAULT nextval('diary_comments_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: diary_entries id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entries ALTER COLUMN id SET DEFAULT nextval('diary_entries_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: friends id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY friends ALTER COLUMN id SET DEFAULT nextval('friends_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: gpx_file_tags id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_file_tags ALTER COLUMN id SET DEFAULT nextval('gpx_file_tags_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: gpx_files id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_files ALTER COLUMN id SET DEFAULT nextval('gpx_files_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: messages id; Type: DEFAULT; Schema: public; Owner: - -- +ALTER TABLE ONLY issue_comments ALTER COLUMN id SET DEFAULT nextval('issue_comments_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: note_comments id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY note_comments ALTER COLUMN id SET DEFAULT nextval('note_comments_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: notes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: oauth_nonces id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_nonces ALTER COLUMN id SET DEFAULT nextval('oauth_nonces_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: oauth_tokens id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_tokens_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: redactions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY redactions ALTER COLUMN id SET DEFAULT nextval('redactions_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: user_blocks id; Type: DEFAULT; Schema: public; Owner: - -- +ALTER TABLE ONLY reports ALTER COLUMN id SET DEFAULT nextval('reports_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + ALTER TABLE ONLY user_blocks ALTER COLUMN id SET DEFAULT nextval('user_blocks_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: user_roles id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY user_roles ALTER COLUMN id SET DEFAULT nextval('user_roles_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: user_tokens id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY user_tokens ALTER COLUMN id SET DEFAULT nextval('user_tokens_id_seq'::regclass); -- - -- Name: id; Type: DEFAULT; Schema: public; Owner: - + -- Name: users id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); -- - -- Name: acls_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: acls acls_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY acls @@@ -1505,7 -1362,7 +1500,7 @@@ -- - -- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY ar_internal_metadata @@@ -1513,7 -1370,7 +1508,7 @@@ -- - -- Name: changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: changeset_comments changeset_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changeset_comments @@@ -1521,7 -1378,7 +1516,7 @@@ -- - -- Name: changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: changesets changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changesets @@@ -1529,7 -1386,7 +1524,7 @@@ -- - -- Name: client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: client_applications client_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY client_applications @@@ -1537,7 -1394,7 +1532,7 @@@ -- - -- Name: current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_node_tags current_node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_node_tags @@@ -1545,7 -1402,7 +1540,7 @@@ -- - -- Name: current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_nodes current_nodes_pkey1; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_nodes @@@ -1553,7 -1410,7 +1548,7 @@@ -- - -- Name: current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_relation_members current_relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relation_members @@@ -1561,7 -1418,7 +1556,7 @@@ -- - -- Name: current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_relation_tags current_relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relation_tags @@@ -1569,7 -1426,7 +1564,7 @@@ -- - -- Name: current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_relations current_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relations @@@ -1577,7 -1434,7 +1572,7 @@@ -- - -- Name: current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_way_nodes current_way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_way_nodes @@@ -1585,7 -1442,7 +1580,7 @@@ -- - -- Name: current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_way_tags current_way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_way_tags @@@ -1593,7 -1450,7 +1588,7 @@@ -- - -- Name: current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: current_ways current_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_ways @@@ -1601,7 -1458,7 +1596,7 @@@ -- - -- Name: diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: diary_comments diary_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_comments @@@ -1609,7 -1466,7 +1604,7 @@@ -- - -- Name: diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entries diary_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entries @@@ -1617,7 -1474,7 +1612,7 @@@ -- - -- Name: diary_entry_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entry_subscriptions diary_entry_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entry_subscriptions @@@ -1625,7 -1482,7 +1620,7 @@@ -- - -- Name: friends_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: friends friends_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY friends @@@ -1633,7 -1490,7 +1628,7 @@@ -- - -- Name: gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: gpx_file_tags gpx_file_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_file_tags @@@ -1641,31 -1498,15 +1636,31 @@@ -- - -- Name: gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: gpx_files gpx_files_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_files ADD CONSTRAINT gpx_files_pkey PRIMARY KEY (id); +-- +-- Name: issue_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issue_comments + ADD CONSTRAINT issue_comments_pkey PRIMARY KEY (id); + + +-- +-- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issues + ADD CONSTRAINT issues_pkey PRIMARY KEY (id); + + -- - -- Name: languages_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: languages languages_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY languages @@@ -1673,7 -1514,7 +1668,7 @@@ -- - -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY messages @@@ -1681,7 -1522,7 +1676,7 @@@ -- - -- Name: node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: node_tags node_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY node_tags @@@ -1689,7 -1530,7 +1684,7 @@@ -- - -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY nodes @@@ -1697,7 -1538,7 +1692,7 @@@ -- - -- Name: note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: note_comments note_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY note_comments @@@ -1705,7 -1546,7 +1700,7 @@@ -- - -- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: notes notes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY notes @@@ -1713,7 -1554,7 +1708,7 @@@ -- - -- Name: oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: oauth_nonces oauth_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_nonces @@@ -1721,7 -1562,7 +1716,7 @@@ -- - -- Name: oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: oauth_tokens oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_tokens @@@ -1729,7 -1570,7 +1724,7 @@@ -- - -- Name: redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: redactions redactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY redactions @@@ -1737,7 -1578,7 +1732,7 @@@ -- - -- Name: relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: relation_members relation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relation_members @@@ -1745,7 -1586,7 +1740,7 @@@ -- - -- Name: relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: relation_tags relation_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relation_tags @@@ -1753,23 -1594,15 +1748,23 @@@ -- - -- Name: relations_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: relations relations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relations ADD CONSTRAINT relations_pkey PRIMARY KEY (relation_id, version); +-- +-- Name: reports_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY reports + ADD CONSTRAINT reports_pkey PRIMARY KEY (id); + + -- - -- Name: user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: user_blocks user_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_blocks @@@ -1777,7 -1610,7 +1772,7 @@@ -- - -- Name: user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: user_preferences user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_preferences @@@ -1785,7 -1618,7 +1780,7 @@@ -- - -- Name: user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: user_roles user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_roles @@@ -1793,7 -1626,7 +1788,7 @@@ -- - -- Name: user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: user_tokens user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_tokens @@@ -1801,7 -1634,7 +1796,7 @@@ -- - -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY users @@@ -1809,7 -1642,7 +1804,7 @@@ -- - -- Name: way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: way_nodes way_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY way_nodes @@@ -1817,7 -1650,7 +1812,7 @@@ -- - -- Name: way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: way_tags way_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY way_tags @@@ -1825,7 -1658,7 +1820,7 @@@ -- - -- Name: ways_pkey; Type: CONSTRAINT; Schema: public; Owner: - + -- Name: ways ways_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY ways @@@ -2042,41 -1875,6 +2037,41 @@@ CREATE INDEX index_client_applications_ CREATE INDEX index_diary_entry_subscriptions_on_diary_entry_id ON diary_entry_subscriptions USING btree (diary_entry_id); +-- +-- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_issue_comments_on_issue_id ON issue_comments USING btree (issue_id); + + +-- +-- Name: index_issue_comments_on_user_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_issue_comments_on_user_id ON issue_comments USING btree (user_id); + + +-- +-- Name: index_issues_on_reportable_type_and_reportable_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_issues_on_reportable_type_and_reportable_id ON issues USING btree (reportable_type, reportable_id); + + +-- +-- Name: index_issues_on_reported_user_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_issues_on_reported_user_id ON issues USING btree (reported_user_id); + + +-- +-- Name: index_issues_on_updated_by; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_issues_on_updated_by ON issues USING btree (updated_by); + + -- -- Name: index_note_comments_on_body; Type: INDEX; Schema: public; Owner: - -- @@@ -2112,20 -1910,6 +2107,20 @@@ CREATE UNIQUE INDEX index_oauth_tokens_ CREATE INDEX index_oauth_tokens_on_user_id ON oauth_tokens USING btree (user_id); +-- +-- Name: index_reports_on_issue_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_reports_on_issue_id ON reports USING btree (issue_id); + + +-- +-- Name: index_reports_on_user_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_reports_on_user_id ON reports USING btree (user_id); + + -- -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: - -- @@@ -2301,6 -2085,13 +2296,13 @@@ CREATE UNIQUE INDEX users_email_idx ON CREATE INDEX users_email_lower_idx ON users USING btree (lower((email)::text)); + -- + -- Name: users_home_idx; Type: INDEX; Schema: public; Owner: - + -- + + CREATE INDEX users_home_idx ON users USING btree (home_tile); + + -- -- Name: way_nodes_node_idx; Type: INDEX; Schema: public; Owner: - -- @@@ -2323,7 -2114,7 +2325,7 @@@ CREATE INDEX ways_timestamp_idx ON way -- - -- Name: changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changeset_comments changeset_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changeset_comments @@@ -2331,7 -2122,7 +2333,7 @@@ -- - -- Name: changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changeset_comments changeset_comments_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changeset_comments @@@ -2339,7 -2130,7 +2341,7 @@@ -- - -- Name: changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changeset_tags changeset_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changeset_tags @@@ -2347,7 -2138,7 +2349,7 @@@ -- - -- Name: changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changesets_subscribers changesets_subscribers_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changesets_subscribers @@@ -2355,7 -2146,7 +2357,7 @@@ -- - -- Name: changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changesets_subscribers changesets_subscribers_subscriber_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changesets_subscribers @@@ -2363,7 -2154,7 +2365,7 @@@ -- - -- Name: changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: changesets changesets_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY changesets @@@ -2371,7 -2162,7 +2373,7 @@@ -- - -- Name: client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: client_applications client_applications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY client_applications @@@ -2379,7 -2170,7 +2381,7 @@@ -- - -- Name: current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_node_tags current_node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_node_tags @@@ -2387,7 -2178,7 +2389,7 @@@ -- - -- Name: current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_nodes current_nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_nodes @@@ -2395,7 -2186,7 +2397,7 @@@ -- - -- Name: current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_relation_members current_relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relation_members @@@ -2403,7 -2194,7 +2405,7 @@@ -- - -- Name: current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_relation_tags current_relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relation_tags @@@ -2411,7 -2202,7 +2413,7 @@@ -- - -- Name: current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_relations current_relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_relations @@@ -2419,7 -2210,7 +2421,7 @@@ -- - -- Name: current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_way_nodes current_way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_way_nodes @@@ -2427,7 -2218,7 +2429,7 @@@ -- - -- Name: current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_way_nodes current_way_nodes_node_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_way_nodes @@@ -2435,7 -2226,7 +2437,7 @@@ -- - -- Name: current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_way_tags current_way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_way_tags @@@ -2443,7 -2234,7 +2445,7 @@@ -- - -- Name: current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: current_ways current_ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY current_ways @@@ -2451,7 -2242,7 +2453,7 @@@ -- - -- Name: diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_comments diary_comments_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_comments @@@ -2459,7 -2250,7 +2461,7 @@@ -- - -- Name: diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_comments diary_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_comments @@@ -2467,7 -2258,7 +2469,7 @@@ -- - -- Name: diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entries diary_entries_language_code_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entries @@@ -2475,7 -2266,7 +2477,7 @@@ -- - -- Name: diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entries diary_entries_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entries @@@ -2483,7 -2274,7 +2485,7 @@@ -- - -- Name: diary_entry_subscriptions_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entry_subscriptions diary_entry_subscriptions_diary_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entry_subscriptions @@@ -2491,7 -2282,7 +2493,7 @@@ -- - -- Name: diary_entry_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: diary_entry_subscriptions diary_entry_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY diary_entry_subscriptions @@@ -2499,7 -2290,7 +2501,7 @@@ -- - -- Name: friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: friends friends_friend_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY friends @@@ -2507,7 -2298,7 +2509,7 @@@ -- - -- Name: friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: friends friends_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY friends @@@ -2515,7 -2306,7 +2517,7 @@@ -- - -- Name: gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: gps_points gps_points_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY gps_points @@@ -2523,7 -2314,7 +2525,7 @@@ -- - -- Name: gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: gpx_file_tags gpx_file_tags_gpx_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_file_tags @@@ -2531,55 -2322,15 +2533,55 @@@ -- - -- Name: gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: gpx_files gpx_files_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY gpx_files ADD CONSTRAINT gpx_files_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); +-- +-- Name: issue_comments_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issue_comments + ADD CONSTRAINT issue_comments_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id); + + +-- +-- Name: issue_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issue_comments + ADD CONSTRAINT issue_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); + + +-- +-- Name: issues_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issues + ADD CONSTRAINT issues_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES users(id); + + +-- +-- Name: issues_resolved_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issues + ADD CONSTRAINT issues_resolved_by_fkey FOREIGN KEY (resolved_by) REFERENCES users(id); + + +-- +-- Name: issues_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY issues + ADD CONSTRAINT issues_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES users(id); + + -- - -- Name: messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: messages messages_from_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY messages @@@ -2587,7 -2338,7 +2589,7 @@@ -- - -- Name: messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: messages messages_to_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY messages @@@ -2595,7 -2346,7 +2597,7 @@@ -- - -- Name: node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: node_tags node_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY node_tags @@@ -2603,7 -2354,7 +2605,7 @@@ -- - -- Name: nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: nodes nodes_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY nodes @@@ -2611,7 -2362,7 +2613,7 @@@ -- - -- Name: nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: nodes nodes_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY nodes @@@ -2619,7 -2370,7 +2621,7 @@@ -- - -- Name: note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: note_comments note_comments_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY note_comments @@@ -2627,7 -2378,7 +2629,7 @@@ -- - -- Name: note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: note_comments note_comments_note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY note_comments @@@ -2635,7 -2386,7 +2637,7 @@@ -- - -- Name: oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: oauth_tokens oauth_tokens_client_application_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_tokens @@@ -2643,7 -2394,7 +2645,7 @@@ -- - -- Name: oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: oauth_tokens oauth_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY oauth_tokens @@@ -2651,7 -2402,7 +2653,7 @@@ -- - -- Name: redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: redactions redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY redactions @@@ -2659,7 -2410,7 +2661,7 @@@ -- - -- Name: relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: relation_members relation_members_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relation_members @@@ -2667,7 -2418,7 +2669,7 @@@ -- - -- Name: relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: relation_tags relation_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relation_tags @@@ -2675,7 -2426,7 +2677,7 @@@ -- - -- Name: relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: relations relations_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relations @@@ -2683,31 -2434,15 +2685,31 @@@ -- - -- Name: relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: relations relations_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY relations ADD CONSTRAINT relations_redaction_id_fkey FOREIGN KEY (redaction_id) REFERENCES redactions(id); +-- +-- Name: reports_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY reports + ADD CONSTRAINT reports_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id); + + +-- +-- Name: reports_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY reports + ADD CONSTRAINT reports_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); + + -- - -- Name: user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_blocks user_blocks_moderator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_blocks @@@ -2715,7 -2450,7 +2717,7 @@@ -- - -- Name: user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_blocks user_blocks_revoker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_blocks @@@ -2723,7 -2458,7 +2725,7 @@@ -- - -- Name: user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_blocks user_blocks_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_blocks @@@ -2731,7 -2466,7 +2733,7 @@@ -- - -- Name: user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_preferences user_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_preferences @@@ -2739,7 -2474,7 +2741,7 @@@ -- - -- Name: user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_roles user_roles_granter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_roles @@@ -2747,7 -2482,7 +2749,7 @@@ -- - -- Name: user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_roles user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_roles @@@ -2755,7 -2490,7 +2757,7 @@@ -- - -- Name: user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: user_tokens user_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_tokens @@@ -2763,7 -2498,7 +2765,7 @@@ -- - -- Name: way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: way_nodes way_nodes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY way_nodes @@@ -2771,7 -2506,7 +2773,7 @@@ -- - -- Name: way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: way_tags way_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY way_tags @@@ -2779,7 -2514,7 +2781,7 @@@ -- - -- Name: ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: ways ways_changeset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY ways @@@ -2787,7 -2522,7 +2789,7 @@@ -- - -- Name: ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - + -- Name: ways ways_redaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY ways @@@ -2849,10 -2584,10 +2851,11 @@@ INSERT INTO "schema_migrations" (versio ('20150111192335'), ('20150222101847'), ('20150818224516'), +('20160822153055'), ('20161002153425'), ('20161011010929'), ('20170222134109'), + ('20180204153242'), ('21'), ('22'), ('23'), @@@ -2897,5 -2632,5 +2900,3 @@@ ('7'), ('8'), ('9'); -- -- diff --combined test/test_helper.rb index 95d48bd5c,385a2f682..7198519a7 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@@ -2,7 -2,7 +2,7 @@@ require "coveralls Coveralls.wear!("rails") ENV["RAILS_ENV"] = "test" - require File.expand_path("../../config/environment", __FILE__) + require File.expand_path("../config/environment", __dir__) require "rails/test_help" require "webmock/minitest" @@@ -150,13 -150,5 +150,13 @@@ module ActiveSuppor end end end + + def sign_in_as(user) + stub_hostip_requests + visit login_path + fill_in "username", :with => user.email + fill_in "password", :with => "test" + click_on "Login", :match => :first + end end end