]> git.openstreetmap.org Git - rails.git/commitdiff
Add annotate gem and associated rake task. Annotate models.
authorAndy Allan <git@gravitystorm.co.uk>
Sun, 22 Oct 2017 21:18:26 +0000 (22:18 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Sun, 22 Oct 2017 21:18:26 +0000 (22:18 +0100)
47 files changed:
Gemfile
Gemfile.lock
app/models/access_token.rb
app/models/acl.rb
app/models/changeset.rb
app/models/changeset_comment.rb
app/models/changeset_tag.rb
app/models/client_application.rb
app/models/diary_comment.rb
app/models/diary_entry.rb
app/models/diary_entry_subscription.rb
app/models/friend.rb
app/models/language.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/oauth2_token.rb
app/models/oauth2_verifier.rb
app/models/oauth_nonce.rb
app/models/oauth_token.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/request_token.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_preference.rb
app/models/user_role.rb
app/models/user_token.rb
app/models/way.rb
app/models/way_node.rb
app/models/way_tag.rb
lib/tasks/auto_annotate_models.rake [new file with mode: 0644]

diff --git a/Gemfile b/Gemfile
index ae1b472a2aa0bbdc5ac6e34d7c2dae3988765105..319a25db69ea2c825385450f55a227a25ac51e19 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -106,6 +106,7 @@ gem "logstasher"
 group :development do
   gem "listen"
   gem "vendorer"
 group :development do
   gem "listen"
   gem "vendorer"
+  gem "annotate"
 end
 
 # Gems needed for running tests
 end
 
 # Gems needed for running tests
index 3cd36d5adb778bbc81a20a66520e8db81a01c127..046f8a462d54a5881620239251c063091ac87f15 100644 (file)
@@ -43,6 +43,9 @@ GEM
       tzinfo (~> 1.1)
     addressable (2.5.2)
       public_suffix (>= 2.0.2, < 4.0)
       tzinfo (~> 1.1)
     addressable (2.5.2)
       public_suffix (>= 2.0.2, < 4.0)
+    annotate (2.7.2)
+      activerecord (>= 3.2, < 6.0)
+      rake (>= 10.4, < 13.0)
     arel (7.1.4)
     ast (2.3.0)
     autoprefixer-rails (7.1.4.1)
     arel (7.1.4)
     ast (2.3.0)
     autoprefixer-rails (7.1.4.1)
@@ -351,6 +354,7 @@ PLATFORMS
 DEPENDENCIES
   SystemTimer (>= 1.1.3)
   actionpack-page_caching
 DEPENDENCIES
   SystemTimer (>= 1.1.3)
   actionpack-page_caching
+  annotate
   autoprefixer-rails
   bigdecimal (~> 1.1.0)
   canonical-rails
   autoprefixer-rails
   bigdecimal (~> 1.1.0)
   canonical-rails
@@ -408,4 +412,4 @@ DEPENDENCIES
   webmock
 
 BUNDLED WITH
   webmock
 
 BUNDLED WITH
-   1.13.7
+   1.15.4
index f690c97542472dfa4fdbc54b5826e5dea4cf2d37..e5ba2e240916cce272059fa4abd316501ed785ac 100644 (file)
@@ -1,3 +1,40 @@
+# == Schema Information
+#
+# Table name: oauth_tokens
+#
+#  id                    :integer          not null, primary key
+#  user_id               :integer
+#  type                  :string(20)
+#  client_application_id :integer
+#  token                 :string(50)
+#  secret                :string(50)
+#  authorized_at         :datetime
+#  invalidated_at        :datetime
+#  created_at            :datetime
+#  updated_at            :datetime
+#  allow_read_prefs      :boolean          default(FALSE), not null
+#  allow_write_prefs     :boolean          default(FALSE), not null
+#  allow_write_diary     :boolean          default(FALSE), not null
+#  allow_write_api       :boolean          default(FALSE), not null
+#  allow_read_gpx        :boolean          default(FALSE), not null
+#  allow_write_gpx       :boolean          default(FALSE), not null
+#  callback_url          :string
+#  verifier              :string(20)
+#  scope                 :string
+#  valid_to              :datetime
+#  allow_write_notes     :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_oauth_tokens_on_token    (token) UNIQUE
+#  index_oauth_tokens_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  oauth_tokens_client_application_id_fkey  (client_application_id => client_applications.id)
+#  oauth_tokens_user_id_fkey                (user_id => users.id)
+#
+
 class AccessToken < OauthToken
   belongs_to :user
   belongs_to :client_application
 class AccessToken < OauthToken
   belongs_to :user
   belongs_to :client_application
index 529ccbe3bc26640dfb057674aca5b433ec1582d3..095bad89b942d07e62ee74b18e999100905c456b 100644 (file)
@@ -1,3 +1,18 @@
+# == Schema Information
+#
+# Table name: acls
+#
+#  id      :integer          not null, primary key
+#  address :inet
+#  k       :string           not null
+#  v       :string
+#  domain  :string
+#
+# Indexes
+#
+#  acls_k_idx  (k)
+#
+
 class Acl < ActiveRecord::Base
   validates :k, :presence => true
 
 class Acl < ActiveRecord::Base
   validates :k, :presence => true
 
index a4daab80113739cccdf62aab1050978d2f8f3a86..37d26e0a7bf82e1bb911382c82d9be174fa29e47 100644 (file)
@@ -1,3 +1,30 @@
+# == Schema Information
+#
+# Table name: changesets
+#
+#  id          :integer          not null, primary key
+#  user_id     :integer          not null
+#  created_at  :datetime         not null
+#  min_lat     :integer
+#  max_lat     :integer
+#  min_lon     :integer
+#  max_lon     :integer
+#  closed_at   :datetime         not null
+#  num_changes :integer          default(0), not null
+#
+# Indexes
+#
+#  changesets_bbox_idx                (min_lat,max_lat,min_lon,max_lon)
+#  changesets_closed_at_idx           (closed_at)
+#  changesets_created_at_idx          (created_at)
+#  changesets_user_id_created_at_idx  (user_id,created_at)
+#  changesets_user_id_id_idx          (user_id,id)
+#
+# Foreign Keys
+#
+#  changesets_user_id_fkey  (user_id => users.id)
+#
+
 class Changeset < ActiveRecord::Base
   require "xml/libxml"
 
 class Changeset < ActiveRecord::Base
   require "xml/libxml"
 
index 2fedadff04129e72e0d5eaee741309246c485d28..756fda14c6e7b85adb198d89ddf002316ce9d740 100644 (file)
@@ -1,3 +1,24 @@
+# == Schema Information
+#
+# Table name: changeset_comments
+#
+#  id           :integer          not null, primary key
+#  changeset_id :integer          not null
+#  author_id    :integer          not null
+#  body         :text             not null
+#  created_at   :datetime         not null
+#  visible      :boolean          not null
+#
+# Indexes
+#
+#  index_changeset_comments_on_created_at  (created_at)
+#
+# Foreign Keys
+#
+#  changeset_comments_author_id_fkey     (author_id => users.id)
+#  changeset_comments_changeset_id_fkey  (changeset_id => changesets.id)
+#
+
 class ChangesetComment < ActiveRecord::Base
   belongs_to :changeset
   belongs_to :author, :class_name => "User"
 class ChangesetComment < ActiveRecord::Base
   belongs_to :changeset
   belongs_to :author, :class_name => "User"
index 7ffba0dc3350c0348c094d4b7ddd0e8893fbeea4..8d6cd45ac3bb1056aa72f8643b4dfd7c8c37ffe1 100644 (file)
@@ -1,3 +1,20 @@
+# == Schema Information
+#
+# Table name: changeset_tags
+#
+#  changeset_id :integer          not null, primary key
+#  k            :string           default(""), not null, primary key
+#  v            :string           default(""), not null
+#
+# Indexes
+#
+#  changeset_tags_id_idx  (changeset_id)
+#
+# Foreign Keys
+#
+#  changeset_tags_id_fkey  (changeset_id => changesets.id)
+#
+
 class ChangesetTag < ActiveRecord::Base
   self.primary_keys = "changeset_id", "k"
 
 class ChangesetTag < ActiveRecord::Base
   self.primary_keys = "changeset_id", "k"
 
index 85b6ba68a131664f4fcdb7899bc8c480da5e0bb3..90523a2655ebb60dc45d93e6cff85f330e93191d 100644 (file)
@@ -1,3 +1,35 @@
+# == Schema Information
+#
+# Table name: client_applications
+#
+#  id                :integer          not null, primary key
+#  name              :string
+#  url               :string
+#  support_url       :string
+#  callback_url      :string
+#  key               :string(50)
+#  secret            :string(50)
+#  user_id           :integer
+#  created_at        :datetime
+#  updated_at        :datetime
+#  allow_read_prefs  :boolean          default(FALSE), not null
+#  allow_write_prefs :boolean          default(FALSE), not null
+#  allow_write_diary :boolean          default(FALSE), not null
+#  allow_write_api   :boolean          default(FALSE), not null
+#  allow_read_gpx    :boolean          default(FALSE), not null
+#  allow_write_gpx   :boolean          default(FALSE), not null
+#  allow_write_notes :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_client_applications_on_key      (key) UNIQUE
+#  index_client_applications_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  client_applications_user_id_fkey  (user_id => users.id)
+#
+
 require "oauth"
 
 class ClientApplication < ActiveRecord::Base
 require "oauth"
 
 class ClientApplication < ActiveRecord::Base
index 2796eb612ac8eea869270fc7cee2f72bb73b6da8..8a99c7b2ce461fdc80ebed2987149f4c2e8e93b1 100644 (file)
@@ -1,3 +1,27 @@
+# == Schema Information
+#
+# Table name: diary_comments
+#
+#  id             :integer          not null, primary key
+#  diary_entry_id :integer          not null
+#  user_id        :integer          not null
+#  body           :text             not null
+#  created_at     :datetime         not null
+#  updated_at     :datetime         not null
+#  visible        :boolean          default(TRUE), not null
+#  body_format    :enum             default("markdown"), not null
+#
+# Indexes
+#
+#  diary_comment_user_id_created_at_index  (user_id,created_at)
+#  diary_comments_entry_id_idx             (diary_entry_id,id) UNIQUE
+#
+# Foreign Keys
+#
+#  diary_comments_diary_entry_id_fkey  (diary_entry_id => diary_entries.id)
+#  diary_comments_user_id_fkey         (user_id => users.id)
+#
+
 class DiaryComment < ActiveRecord::Base
   belongs_to :user
   belongs_to :diary_entry
 class DiaryComment < ActiveRecord::Base
   belongs_to :user
   belongs_to :diary_entry
index 143ddc1dc0949ad74b451501ae7a20ec8ec38273..2a24d800296b80902fffdd33656e67447505e9a5 100644 (file)
@@ -1,3 +1,31 @@
+# == Schema Information
+#
+# Table name: diary_entries
+#
+#  id            :integer          not null, primary key
+#  user_id       :integer          not null
+#  title         :string           not null
+#  body          :text             not null
+#  created_at    :datetime         not null
+#  updated_at    :datetime         not null
+#  latitude      :float
+#  longitude     :float
+#  language_code :string           default("en"), not null
+#  visible       :boolean          default(TRUE), not null
+#  body_format   :enum             default("markdown"), not null
+#
+# Indexes
+#
+#  diary_entry_created_at_index                (created_at)
+#  diary_entry_language_code_created_at_index  (language_code,created_at)
+#  diary_entry_user_id_created_at_index        (user_id,created_at)
+#
+# Foreign Keys
+#
+#  diary_entries_language_code_fkey  (language_code => languages.code)
+#  diary_entries_user_id_fkey        (user_id => users.id)
+#
+
 class DiaryEntry < ActiveRecord::Base
   belongs_to :user, :counter_cache => true
   belongs_to :language, :foreign_key => "language_code"
 class DiaryEntry < ActiveRecord::Base
   belongs_to :user, :counter_cache => true
   belongs_to :language, :foreign_key => "language_code"
index 8b96f60743fbedd5ca1b4acda887d248c0dce86e..6d24c4598c42af2eb22c98732c05f605f1d6a166 100644 (file)
@@ -1,3 +1,20 @@
+# == Schema Information
+#
+# Table name: diary_entry_subscriptions
+#
+#  user_id        :integer          not null, primary key
+#  diary_entry_id :integer          not null, primary key
+#
+# Indexes
+#
+#  index_diary_entry_subscriptions_on_diary_entry_id  (diary_entry_id)
+#
+# Foreign Keys
+#
+#  diary_entry_subscriptions_diary_entry_id_fkey  (diary_entry_id => diary_entries.id)
+#  diary_entry_subscriptions_user_id_fkey         (user_id => users.id)
+#
+
 class DiaryEntrySubscription < ActiveRecord::Base
   self.primary_keys = "user_id", "diary_entry_id"
 
 class DiaryEntrySubscription < ActiveRecord::Base
   self.primary_keys = "user_id", "diary_entry_id"
 
index d740a711cfaef4c97dcbcb7d17a2de812f0e2b16..86da87b932ac99b332e95c864f346c12cc8a7ba4 100644 (file)
@@ -1,3 +1,22 @@
+# == Schema Information
+#
+# Table name: friends
+#
+#  id             :integer          not null, primary key
+#  user_id        :integer          not null
+#  friend_user_id :integer          not null
+#
+# Indexes
+#
+#  friends_user_id_idx  (user_id)
+#  user_id_idx          (friend_user_id)
+#
+# Foreign Keys
+#
+#  friends_friend_user_id_fkey  (friend_user_id => users.id)
+#  friends_user_id_fkey         (user_id => users.id)
+#
+
 class Friend < ActiveRecord::Base
   belongs_to :befriender, :class_name => "User", :foreign_key => :user_id
   belongs_to :befriendee, :class_name => "User", :foreign_key => :friend_user_id
 class Friend < ActiveRecord::Base
   belongs_to :befriender, :class_name => "User", :foreign_key => :user_id
   belongs_to :befriendee, :class_name => "User", :foreign_key => :friend_user_id
index 776182e6376c90e8be6224e3fcd9a580f0c26e9b..67e98569bbf14315099efb4b79d40dc7ef32e2ad 100644 (file)
@@ -1,3 +1,12 @@
+# == Schema Information
+#
+# Table name: languages
+#
+#  code         :string           not null, primary key
+#  english_name :string           not null
+#  native_name  :string
+#
+
 class Language < ActiveRecord::Base
   self.primary_key = "code"
 
 class Language < ActiveRecord::Base
   self.primary_key = "code"
 
index 2a0cea4a1faa7840c10d5b9f2c2f79169a989237..aff628e035901e685c18515902087db8e48a088d 100644 (file)
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: messages
+#
+#  id                :integer          not null, primary key
+#  from_user_id      :integer          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        :integer          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
+#
+# Indexes
+#
+#  messages_from_user_id_idx  (from_user_id)
+#  messages_to_user_id_idx    (to_user_id)
+#
+# Foreign Keys
+#
+#  messages_from_user_id_fkey  (from_user_id => users.id)
+#  messages_to_user_id_fkey    (to_user_id => users.id)
+#
+
 require "validators"
 
 class Message < ActiveRecord::Base
 require "validators"
 
 class Message < ActiveRecord::Base
index edbbbc251b31f57cff7f429da6ac487bcffdfb1a..c09fcbd6778cbce6083c14cdd15653b3da957237 100644 (file)
@@ -1,3 +1,26 @@
+# == Schema Information
+#
+# Table name: current_nodes
+#
+#  id           :integer          not null, primary key
+#  latitude     :integer          not null
+#  longitude    :integer          not null
+#  changeset_id :integer          not null
+#  visible      :boolean          not null
+#  timestamp    :datetime         not null
+#  tile         :integer          not null
+#  version      :integer          not null
+#
+# Indexes
+#
+#  current_nodes_tile_idx       (tile)
+#  current_nodes_timestamp_idx  (timestamp)
+#
+# Foreign Keys
+#
+#  current_nodes_changeset_id_fkey  (changeset_id => changesets.id)
+#
+
 class Node < ActiveRecord::Base
   require "xml/libxml"
 
 class Node < ActiveRecord::Base
   require "xml/libxml"
 
index 5f2f9efc9107036fef2bb97b244d63325c1efe15..20065b993137f8e1df485c24c81d716371c062ae 100644 (file)
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: current_node_tags
+#
+#  node_id :integer          not null, primary key
+#  k       :string           default(""), not null, primary key
+#  v       :string           default(""), not null
+#
+# Foreign Keys
+#
+#  current_node_tags_id_fkey  (node_id => current_nodes.id)
+#
+
 class NodeTag < ActiveRecord::Base
   self.table_name = "current_node_tags"
   self.primary_keys = "node_id", "k"
 class NodeTag < ActiveRecord::Base
   self.table_name = "current_node_tags"
   self.primary_keys = "node_id", "k"
index d2c36071da0dfe5b3e8a545446ebe9c0396f6ad6..b7f6928b869a75c626422b46438b81a4f7d38262 100644 (file)
@@ -1,3 +1,23 @@
+# == Schema Information
+#
+# Table name: notes
+#
+#  id         :integer          not null, primary key
+#  latitude   :integer          not null
+#  longitude  :integer          not null
+#  tile       :integer          not null
+#  updated_at :datetime         not null
+#  created_at :datetime         not null
+#  status     :enum             not null
+#  closed_at  :datetime
+#
+# Indexes
+#
+#  notes_created_at_idx   (created_at)
+#  notes_tile_status_idx  (tile,status)
+#  notes_updated_at_idx   (updated_at)
+#
+
 class Note < ActiveRecord::Base
   include GeoRecord
 
 class Note < ActiveRecord::Base
   include GeoRecord
 
index aa8635aadde724c6bbb233650460d27a2471b49b..f8450d0a369625be13158760ae3ae5eb70ec5635 100644 (file)
@@ -1,3 +1,28 @@
+# == Schema Information
+#
+# Table name: note_comments
+#
+#  id         :integer          not null, primary key
+#  note_id    :integer          not null
+#  visible    :boolean          not null
+#  created_at :datetime         not null
+#  author_ip  :inet
+#  author_id  :integer
+#  body       :text
+#  event      :enum
+#
+# Indexes
+#
+#  index_note_comments_on_body        (to_tsvector('english'::regconfig, body))
+#  index_note_comments_on_created_at  (created_at)
+#  note_comments_note_id_idx          (note_id)
+#
+# Foreign Keys
+#
+#  note_comments_author_id_fkey  (author_id => users.id)
+#  note_comments_note_id_fkey    (note_id => notes.id)
+#
+
 class NoteComment < ActiveRecord::Base
   belongs_to :note, :foreign_key => :note_id, :touch => true
   belongs_to :author, :class_name => "User", :foreign_key => :author_id
 class NoteComment < ActiveRecord::Base
   belongs_to :note, :foreign_key => :note_id, :touch => true
   belongs_to :author, :class_name => "User", :foreign_key => :author_id
index 2c0b1f50814b63e283f868df060ffba4c56ecf34..3435b25a31494dbf2b7a386211689b3048df8f1d 100644 (file)
@@ -1,3 +1,40 @@
+# == Schema Information
+#
+# Table name: oauth_tokens
+#
+#  id                    :integer          not null, primary key
+#  user_id               :integer
+#  type                  :string(20)
+#  client_application_id :integer
+#  token                 :string(50)
+#  secret                :string(50)
+#  authorized_at         :datetime
+#  invalidated_at        :datetime
+#  created_at            :datetime
+#  updated_at            :datetime
+#  allow_read_prefs      :boolean          default(FALSE), not null
+#  allow_write_prefs     :boolean          default(FALSE), not null
+#  allow_write_diary     :boolean          default(FALSE), not null
+#  allow_write_api       :boolean          default(FALSE), not null
+#  allow_read_gpx        :boolean          default(FALSE), not null
+#  allow_write_gpx       :boolean          default(FALSE), not null
+#  callback_url          :string
+#  verifier              :string(20)
+#  scope                 :string
+#  valid_to              :datetime
+#  allow_write_notes     :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_oauth_tokens_on_token    (token) UNIQUE
+#  index_oauth_tokens_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  oauth_tokens_client_application_id_fkey  (client_application_id => client_applications.id)
+#  oauth_tokens_user_id_fkey                (user_id => users.id)
+#
+
 class Oauth2Token < AccessToken
   attr_accessor :state
 
 class Oauth2Token < AccessToken
   attr_accessor :state
 
index 1568cac998dd93e191a58821c4949ee6b6e529cb..3eca1038c22333263f8d213974d90ba78066395f 100644 (file)
@@ -1,3 +1,40 @@
+# == Schema Information
+#
+# Table name: oauth_tokens
+#
+#  id                    :integer          not null, primary key
+#  user_id               :integer
+#  type                  :string(20)
+#  client_application_id :integer
+#  token                 :string(50)
+#  secret                :string(50)
+#  authorized_at         :datetime
+#  invalidated_at        :datetime
+#  created_at            :datetime
+#  updated_at            :datetime
+#  allow_read_prefs      :boolean          default(FALSE), not null
+#  allow_write_prefs     :boolean          default(FALSE), not null
+#  allow_write_diary     :boolean          default(FALSE), not null
+#  allow_write_api       :boolean          default(FALSE), not null
+#  allow_read_gpx        :boolean          default(FALSE), not null
+#  allow_write_gpx       :boolean          default(FALSE), not null
+#  callback_url          :string
+#  verifier              :string(20)
+#  scope                 :string
+#  valid_to              :datetime
+#  allow_write_notes     :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_oauth_tokens_on_token    (token) UNIQUE
+#  index_oauth_tokens_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  oauth_tokens_client_application_id_fkey  (client_application_id => client_applications.id)
+#  oauth_tokens_user_id_fkey                (user_id => users.id)
+#
+
 class Oauth2Verifier < OauthToken
   validates :user, :presence => true, :associated => true
 
 class Oauth2Verifier < OauthToken
   validates :user, :presence => true, :associated => true
 
index e0510dcbf85bb59a237b33fca0c8aa6a9008ece2..0952f068edc6b9a9d2525206e1fd5069c8ff7516 100644 (file)
@@ -1,3 +1,18 @@
+# == Schema Information
+#
+# Table name: oauth_nonces
+#
+#  id         :integer          not null, primary key
+#  nonce      :string
+#  timestamp  :integer
+#  created_at :datetime
+#  updated_at :datetime
+#
+# Indexes
+#
+#  index_oauth_nonces_on_nonce_and_timestamp  (nonce,timestamp) UNIQUE
+#
+
 # Simple store of nonces. The OAuth Spec requires that any given pair of nonce and timestamps are unique.
 # Thus you can use the same nonce with a different timestamp and viceversa.
 class OauthNonce < ActiveRecord::Base
 # Simple store of nonces. The OAuth Spec requires that any given pair of nonce and timestamps are unique.
 # Thus you can use the same nonce with a different timestamp and viceversa.
 class OauthNonce < ActiveRecord::Base
index 9a3e7de9eca142c21574f011ef33ee393f573539..fd332723f25c07333cf2ca5d2483ea671887f121 100644 (file)
@@ -1,3 +1,40 @@
+# == Schema Information
+#
+# Table name: oauth_tokens
+#
+#  id                    :integer          not null, primary key
+#  user_id               :integer
+#  type                  :string(20)
+#  client_application_id :integer
+#  token                 :string(50)
+#  secret                :string(50)
+#  authorized_at         :datetime
+#  invalidated_at        :datetime
+#  created_at            :datetime
+#  updated_at            :datetime
+#  allow_read_prefs      :boolean          default(FALSE), not null
+#  allow_write_prefs     :boolean          default(FALSE), not null
+#  allow_write_diary     :boolean          default(FALSE), not null
+#  allow_write_api       :boolean          default(FALSE), not null
+#  allow_read_gpx        :boolean          default(FALSE), not null
+#  allow_write_gpx       :boolean          default(FALSE), not null
+#  callback_url          :string
+#  verifier              :string(20)
+#  scope                 :string
+#  valid_to              :datetime
+#  allow_write_notes     :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_oauth_tokens_on_token    (token) UNIQUE
+#  index_oauth_tokens_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  oauth_tokens_client_application_id_fkey  (client_application_id => client_applications.id)
+#  oauth_tokens_user_id_fkey                (user_id => users.id)
+#
+
 class OauthToken < ActiveRecord::Base
   belongs_to :client_application
   belongs_to :user
 class OauthToken < ActiveRecord::Base
   belongs_to :client_application
   belongs_to :user
index b103e5c7310160033f1d733029b26f5a29da50d7..9690dc46ca807106f7080f41e88e9e94048d6e78 100644 (file)
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: nodes
+#
+#  node_id      :integer          not null, primary key
+#  latitude     :integer          not null
+#  longitude    :integer          not null
+#  changeset_id :integer          not null
+#  visible      :boolean          not null
+#  timestamp    :datetime         not null
+#  tile         :integer          not null
+#  version      :integer          not null, primary key
+#  redaction_id :integer
+#
+# Indexes
+#
+#  nodes_changeset_id_idx  (changeset_id)
+#  nodes_tile_idx          (tile)
+#  nodes_timestamp_idx     (timestamp)
+#
+# Foreign Keys
+#
+#  nodes_changeset_id_fkey  (changeset_id => changesets.id)
+#  nodes_redaction_id_fkey  (redaction_id => redactions.id)
+#
+
 class OldNode < ActiveRecord::Base
   include GeoRecord
   include ConsistencyValidations
 class OldNode < ActiveRecord::Base
   include GeoRecord
   include ConsistencyValidations
index f1df02c84095c279e18f579591e35f09df57645d..9e03d34f983a86553d6ca2fb3b8c7ff5d8472056 100644 (file)
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: node_tags
+#
+#  node_id :integer          not null, primary key
+#  version :integer          not null, primary key
+#  k       :string           default(""), not null, primary key
+#  v       :string           default(""), not null
+#
+# Foreign Keys
+#
+#  node_tags_id_fkey  (node_id => nodes.node_id)
+#
+
 class OldNodeTag < ActiveRecord::Base
   self.table_name = "node_tags"
   self.primary_keys = "node_id", "version", "k"
 class OldNodeTag < ActiveRecord::Base
   self.table_name = "node_tags"
   self.primary_keys = "node_id", "version", "k"
index 0e85122a48b67bba0954e047a95065f7fdb7dceb..3470561cee4df036a318d2901a7c59752ae19bbd 100644 (file)
@@ -1,3 +1,25 @@
+# == Schema Information
+#
+# Table name: relations
+#
+#  relation_id  :integer          default(0), not null, primary key
+#  changeset_id :integer          not null
+#  timestamp    :datetime         not null
+#  version      :integer          not null, primary key
+#  visible      :boolean          default(TRUE), not null
+#  redaction_id :integer
+#
+# Indexes
+#
+#  relations_changeset_id_idx  (changeset_id)
+#  relations_timestamp_idx     (timestamp)
+#
+# Foreign Keys
+#
+#  relations_changeset_id_fkey  (changeset_id => changesets.id)
+#  relations_redaction_id_fkey  (redaction_id => redactions.id)
+#
+
 class OldRelation < ActiveRecord::Base
   include ConsistencyValidations
   include ObjectMetadata
 class OldRelation < ActiveRecord::Base
   include ConsistencyValidations
   include ObjectMetadata
index 77a5a3786eceebfb25c705762f36fe6508d03b94..a746374357d6b47a74b750e191a297646cce43ca 100644 (file)
@@ -1,3 +1,23 @@
+# == Schema Information
+#
+# Table name: relation_members
+#
+#  relation_id :integer          default(0), not null, primary key
+#  member_type :enum             not null
+#  member_id   :integer          not null
+#  member_role :string           not null
+#  version     :integer          default(0), not null, primary key
+#  sequence_id :integer          default(0), not null, primary key
+#
+# Indexes
+#
+#  relation_members_member_idx  (member_type,member_id)
+#
+# Foreign Keys
+#
+#  relation_members_id_fkey  (relation_id => relations.relation_id)
+#
+
 class OldRelationMember < ActiveRecord::Base
   self.table_name = "relation_members"
   self.primary_keys = "relation_id", "version", "sequence_id"
 class OldRelationMember < ActiveRecord::Base
   self.table_name = "relation_members"
   self.primary_keys = "relation_id", "version", "sequence_id"
index ad3b72734aed707bfebc87c4c26562690fa5f9c6..052b60853e9ec0f630d9b8ccd5aef59b81c89575 100644 (file)
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: relation_tags
+#
+#  relation_id :integer          default(0), not null, primary key
+#  k           :string           default(""), not null, primary key
+#  v           :string           default(""), not null
+#  version     :integer          not null, primary key
+#
+# Foreign Keys
+#
+#  relation_tags_id_fkey  (relation_id => relations.relation_id)
+#
+
 class OldRelationTag < ActiveRecord::Base
   self.table_name = "relation_tags"
   self.primary_keys = "relation_id", "version", "k"
 class OldRelationTag < ActiveRecord::Base
   self.table_name = "relation_tags"
   self.primary_keys = "relation_id", "version", "k"
index 63c4d8b65d2d6c4acb24b3a3d111f0a105c9eb72..baca05d33549738c391d373602782515a7a94eff 100644 (file)
@@ -1,3 +1,25 @@
+# == Schema Information
+#
+# Table name: ways
+#
+#  way_id       :integer          default(0), not null, primary key
+#  changeset_id :integer          not null
+#  timestamp    :datetime         not null
+#  version      :integer          not null, primary key
+#  visible      :boolean          default(TRUE), not null
+#  redaction_id :integer
+#
+# Indexes
+#
+#  ways_changeset_id_idx  (changeset_id)
+#  ways_timestamp_idx     (timestamp)
+#
+# Foreign Keys
+#
+#  ways_changeset_id_fkey  (changeset_id => changesets.id)
+#  ways_redaction_id_fkey  (redaction_id => redactions.id)
+#
+
 class OldWay < ActiveRecord::Base
   include ConsistencyValidations
   include ObjectMetadata
 class OldWay < ActiveRecord::Base
   include ConsistencyValidations
   include ObjectMetadata
index 23ff503edf665ff922e6fe4b874f5484734f488f..e1627d3faa3091c002bef4fbb2b0f07a56fd2492 100644 (file)
@@ -1,3 +1,21 @@
+# == Schema Information
+#
+# Table name: way_nodes
+#
+#  way_id      :integer          not null, primary key
+#  node_id     :integer          not null
+#  version     :integer          not null, primary key
+#  sequence_id :integer          not null, primary key
+#
+# Indexes
+#
+#  way_nodes_node_idx  (node_id)
+#
+# Foreign Keys
+#
+#  way_nodes_id_fkey  (way_id => ways.way_id)
+#
+
 class OldWayNode < ActiveRecord::Base
   self.table_name = "way_nodes"
   self.primary_keys = "way_id", "version", "sequence_id"
 class OldWayNode < ActiveRecord::Base
   self.table_name = "way_nodes"
   self.primary_keys = "way_id", "version", "sequence_id"
index 69bd2b1861d12d845d2c3716f8fd651311d781c1..8fffebc2553ab9e8c217195dd8da41c56374f787 100644 (file)
@@ -1,3 +1,17 @@
+# == Schema Information
+#
+# Table name: way_tags
+#
+#  way_id  :integer          default(0), not null, primary key
+#  k       :string           not null, primary key
+#  v       :string           not null
+#  version :integer          not null, primary key
+#
+# Foreign Keys
+#
+#  way_tags_id_fkey  (way_id => ways.way_id)
+#
+
 class OldWayTag < ActiveRecord::Base
   self.table_name = "way_tags"
   self.primary_keys = "way_id", "version", "k"
 class OldWayTag < ActiveRecord::Base
   self.table_name = "way_tags"
   self.primary_keys = "way_id", "version", "k"
index 04f002e3637ccf62c1f808dea10f3b22677e0074..b835864db074b40e7c27cfd8521e0689b96aa979 100644 (file)
@@ -1,3 +1,20 @@
+# == Schema Information
+#
+# Table name: redactions
+#
+#  id                 :integer          not null, primary key
+#  title              :string
+#  description        :text
+#  created_at         :datetime
+#  updated_at         :datetime
+#  user_id            :integer          not null
+#  description_format :enum             default("markdown"), not null
+#
+# Foreign Keys
+#
+#  redactions_user_id_fkey  (user_id => users.id)
+#
+
 ##
 # Redaction represents a record associated with a particular
 # action on the database to hide revisions from the history
 ##
 # Redaction represents a record associated with a particular
 # action on the database to hide revisions from the history
index 54533679302800b944f4dce754920cba4be8ce0c..275cafec24d29090b9e859aabaf2e94de22cd7ca 100644 (file)
@@ -1,3 +1,22 @@
+# == Schema Information
+#
+# Table name: current_relations
+#
+#  id           :integer          not null, primary key
+#  changeset_id :integer          not null
+#  timestamp    :datetime         not null
+#  visible      :boolean          not null
+#  version      :integer          not null
+#
+# Indexes
+#
+#  current_relations_timestamp_idx  (timestamp)
+#
+# Foreign Keys
+#
+#  current_relations_changeset_id_fkey  (changeset_id => changesets.id)
+#
+
 class Relation < ActiveRecord::Base
   require "xml/libxml"
 
 class Relation < ActiveRecord::Base
   require "xml/libxml"
 
index e5c783f5c68b788e7d5f034970a3a4ebc28acd5e..3e5cdfca27e1513856f12c4adf04fc89e95c5bd6 100644 (file)
@@ -1,3 +1,22 @@
+# == Schema Information
+#
+# Table name: current_relation_members
+#
+#  relation_id :integer          not null, primary key
+#  member_type :enum             not null
+#  member_id   :integer          not null
+#  member_role :string           not null
+#  sequence_id :integer          default(0), not null, primary key
+#
+# Indexes
+#
+#  current_relation_members_member_idx  (member_type,member_id)
+#
+# Foreign Keys
+#
+#  current_relation_members_id_fkey  (relation_id => current_relations.id)
+#
+
 class RelationMember < ActiveRecord::Base
   self.table_name = "current_relation_members"
   self.primary_keys = "relation_id", "sequence_id"
 class RelationMember < ActiveRecord::Base
   self.table_name = "current_relation_members"
   self.primary_keys = "relation_id", "sequence_id"
index 382606795cab0416326971239a393173edb6c491..5dc609987370ffbc3731e9f6864fc5b155f65f6a 100644 (file)
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: current_relation_tags
+#
+#  relation_id :integer          not null, primary key
+#  k           :string           default(""), not null, primary key
+#  v           :string           default(""), not null
+#
+# Foreign Keys
+#
+#  current_relation_tags_id_fkey  (relation_id => current_relations.id)
+#
+
 class RelationTag < ActiveRecord::Base
   self.table_name = "current_relation_tags"
   self.primary_keys = "relation_id", "k"
 class RelationTag < ActiveRecord::Base
   self.table_name = "current_relation_tags"
   self.primary_keys = "relation_id", "k"
index c0f0194860f0117fcf71181301bfb2c53385a849..335a735bc5a4dbcab80c07d92f2791df53447509 100644 (file)
@@ -1,3 +1,40 @@
+# == Schema Information
+#
+# Table name: oauth_tokens
+#
+#  id                    :integer          not null, primary key
+#  user_id               :integer
+#  type                  :string(20)
+#  client_application_id :integer
+#  token                 :string(50)
+#  secret                :string(50)
+#  authorized_at         :datetime
+#  invalidated_at        :datetime
+#  created_at            :datetime
+#  updated_at            :datetime
+#  allow_read_prefs      :boolean          default(FALSE), not null
+#  allow_write_prefs     :boolean          default(FALSE), not null
+#  allow_write_diary     :boolean          default(FALSE), not null
+#  allow_write_api       :boolean          default(FALSE), not null
+#  allow_read_gpx        :boolean          default(FALSE), not null
+#  allow_write_gpx       :boolean          default(FALSE), not null
+#  callback_url          :string
+#  verifier              :string(20)
+#  scope                 :string
+#  valid_to              :datetime
+#  allow_write_notes     :boolean          default(FALSE), not null
+#
+# Indexes
+#
+#  index_oauth_tokens_on_token    (token) UNIQUE
+#  index_oauth_tokens_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  oauth_tokens_client_application_id_fkey  (client_application_id => client_applications.id)
+#  oauth_tokens_user_id_fkey                (user_id => users.id)
+#
+
 class RequestToken < OauthToken
   attr_accessor :provided_oauth_verifier
 
 class RequestToken < OauthToken
   attr_accessor :provided_oauth_verifier
 
index a2c1b79a7a99aaf72286cbe2f517565481d1235c..214b0b6470aacc20fbe1262d2b553778b55bf729 100644 (file)
@@ -1,3 +1,30 @@
+# == Schema Information
+#
+# Table name: gpx_files
+#
+#  id          :integer          not null, primary key
+#  user_id     :integer          not null
+#  visible     :boolean          default(TRUE), not null
+#  name        :string           default(""), not null
+#  size        :integer
+#  latitude    :float
+#  longitude   :float
+#  timestamp   :datetime         not null
+#  description :string           default(""), not null
+#  inserted    :boolean          not null
+#  visibility  :enum             default("public"), not null
+#
+# Indexes
+#
+#  gpx_files_timestamp_idx           (timestamp)
+#  gpx_files_user_id_idx             (user_id)
+#  gpx_files_visible_visibility_idx  (visible,visibility)
+#
+# Foreign Keys
+#
+#  gpx_files_user_id_fkey  (user_id => users.id)
+#
+
 class Trace < ActiveRecord::Base
   self.table_name = "gpx_files"
 
 class Trace < ActiveRecord::Base
   self.table_name = "gpx_files"
 
index 9485b8a14086b7d291c42eb24ff85a2fa4ee689c..445688c5554389e66aa90b6e77fb8dca6b354c67 100644 (file)
@@ -1,3 +1,25 @@
+# == Schema Information
+#
+# Table name: gps_points
+#
+#  altitude  :float
+#  trackid   :integer          not null
+#  latitude  :integer          not null
+#  longitude :integer          not null
+#  gpx_id    :integer          not null
+#  timestamp :datetime
+#  tile      :integer
+#
+# Indexes
+#
+#  points_gpxid_idx  (gpx_id)
+#  points_tile_idx   (tile)
+#
+# Foreign Keys
+#
+#  gps_points_gpx_id_fkey  (gpx_id => gpx_files.id)
+#
+
 class Tracepoint < ActiveRecord::Base
   include GeoRecord
 
 class Tracepoint < ActiveRecord::Base
   include GeoRecord
 
index 9d21959205cbcd12edb261fa7ea81fccd4c0fc01..1a4fbd39889195a4653fcc1ed9fec5be3d8e4126 100644 (file)
@@ -1,3 +1,21 @@
+# == Schema Information
+#
+# Table name: gpx_file_tags
+#
+#  gpx_id :integer          default(0), not null
+#  tag    :string           not null
+#  id     :integer          not null, primary key
+#
+# Indexes
+#
+#  gpx_file_tags_gpxid_idx  (gpx_id)
+#  gpx_file_tags_tag_idx    (tag)
+#
+# Foreign Keys
+#
+#  gpx_file_tags_gpx_id_fkey  (gpx_id => gpx_files.id)
+#
+
 class Tracetag < ActiveRecord::Base
   self.table_name = "gpx_file_tags"
 
 class Tracetag < ActiveRecord::Base
   self.table_name = "gpx_file_tags"
 
index 3ce48e7cd34d021724adf2976ede26326fc82c47..7a8414ec073c177940ad9601511467d7d89c96e2 100644 (file)
@@ -1,3 +1,48 @@
+# == Schema Information
+#
+# Table name: users
+#
+#  email               :string           not null
+#  id                  :integer          not null, primary key
+#  pass_crypt          :string           not null
+#  creation_time       :datetime         not null
+#  display_name        :string           default(""), not null
+#  data_public         :boolean          default(FALSE), not null
+#  description         :text             default(""), not null
+#  home_lat            :float
+#  home_lon            :float
+#  home_zoom           :integer          default(3)
+#  nearby              :integer          default(50)
+#  pass_salt           :string
+#  image_file_name     :text
+#  email_valid         :boolean          default(FALSE), not null
+#  new_email           :string
+#  creation_ip         :string
+#  languages           :string
+#  status              :enum             default("pending"), not null
+#  terms_agreed        :datetime
+#  consider_pd         :boolean          default(FALSE), not null
+#  auth_uid            :string
+#  preferred_editor    :string
+#  terms_seen          :boolean          default(FALSE), not null
+#  description_format  :enum             default("markdown"), not null
+#  image_fingerprint   :string
+#  changesets_count    :integer          default(0), not null
+#  traces_count        :integer          default(0), not null
+#  diary_entries_count :integer          default(0), not null
+#  image_use_gravatar  :boolean          default(FALSE), not null
+#  image_content_type  :string
+#  auth_provider       :string
+#
+# Indexes
+#
+#  users_auth_idx                (auth_provider,auth_uid) UNIQUE
+#  users_display_name_idx        (display_name) UNIQUE
+#  users_display_name_lower_idx  (lower((display_name)::text))
+#  users_email_idx               (email) UNIQUE
+#  users_email_lower_idx         (lower((email)::text))
+#
+
 class User < ActiveRecord::Base
   require "xml/libxml"
 
 class User < ActiveRecord::Base
   require "xml/libxml"
 
index eb0daba6569731cad0fe0486b6ea814099e6d2d5..4f9cf11281896f6238e699160616510c91619b86 100644 (file)
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: user_blocks
+#
+#  id            :integer          not null, primary key
+#  user_id       :integer          not null
+#  creator_id    :integer          not null
+#  reason        :text             not null
+#  ends_at       :datetime         not null
+#  needs_view    :boolean          default(FALSE), not null
+#  revoker_id    :integer
+#  created_at    :datetime
+#  updated_at    :datetime
+#  reason_format :enum             default("markdown"), not null
+#
+# Indexes
+#
+#  index_user_blocks_on_user_id  (user_id)
+#
+# Foreign Keys
+#
+#  user_blocks_moderator_id_fkey  (creator_id => users.id)
+#  user_blocks_revoker_id_fkey    (revoker_id => users.id)
+#  user_blocks_user_id_fkey       (user_id => users.id)
+#
+
 class UserBlock < ActiveRecord::Base
   validate :moderator_permissions
 
 class UserBlock < ActiveRecord::Base
   validate :moderator_permissions
 
index 7c65a589953a688e3d4aa87e533ac00e9c8839ce..69b0e9ddec9fc020787c76165f3323ec9cceccd7 100644 (file)
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: user_preferences
+#
+#  user_id :integer          not null, primary key
+#  k       :string           not null, primary key
+#  v       :string           not null
+#
+# Foreign Keys
+#
+#  user_preferences_user_id_fkey  (user_id => users.id)
+#
+
 class UserPreference < ActiveRecord::Base
   self.primary_keys = "user_id", "k"
 
 class UserPreference < ActiveRecord::Base
   self.primary_keys = "user_id", "k"
 
index 967850145f838b4dcff1af82858235dbcecebec7..adf569a03fe79a5d5827a5e33ddf4cdddb12e94d 100644 (file)
@@ -1,3 +1,24 @@
+# == Schema Information
+#
+# Table name: user_roles
+#
+#  id         :integer          not null, primary key
+#  user_id    :integer          not null
+#  role       :enum             not null
+#  created_at :datetime
+#  updated_at :datetime
+#  granter_id :integer          not null
+#
+# Indexes
+#
+#  user_roles_id_role_unique  (user_id,role) UNIQUE
+#
+# Foreign Keys
+#
+#  user_roles_granter_id_fkey  (granter_id => users.id)
+#  user_roles_user_id_fkey     (user_id => users.id)
+#
+
 class UserRole < ActiveRecord::Base
   belongs_to :user
   belongs_to :granter, :class_name => "User"
 class UserRole < ActiveRecord::Base
   belongs_to :user
   belongs_to :granter, :class_name => "User"
index faa540e67c043dd07d0f8dd5e0c6a8e320d5ab29..0d1e16e8acead524674dbca9aafb58398fe6cb14 100644 (file)
@@ -1,3 +1,23 @@
+# == Schema Information
+#
+# Table name: user_tokens
+#
+#  id      :integer          not null, primary key
+#  user_id :integer          not null
+#  token   :string           not null
+#  expiry  :datetime         not null
+#  referer :text
+#
+# Indexes
+#
+#  user_tokens_token_idx    (token) UNIQUE
+#  user_tokens_user_id_idx  (user_id)
+#
+# Foreign Keys
+#
+#  user_tokens_user_id_fkey  (user_id => users.id)
+#
+
 class UserToken < ActiveRecord::Base
   belongs_to :user
 
 class UserToken < ActiveRecord::Base
   belongs_to :user
 
index 212998cccd7372c48b56a7c7ef3841f52291ab27..1954f744ca9332d1c45c7bd133e27f9b7b24bed2 100644 (file)
@@ -1,3 +1,22 @@
+# == Schema Information
+#
+# Table name: current_ways
+#
+#  id           :integer          not null, primary key
+#  changeset_id :integer          not null
+#  timestamp    :datetime         not null
+#  visible      :boolean          not null
+#  version      :integer          not null
+#
+# Indexes
+#
+#  current_ways_timestamp_idx  (timestamp)
+#
+# Foreign Keys
+#
+#  current_ways_changeset_id_fkey  (changeset_id => changesets.id)
+#
+
 class Way < ActiveRecord::Base
   require "xml/libxml"
 
 class Way < ActiveRecord::Base
   require "xml/libxml"
 
index 30d9013565eb9ebf3c78f795e9a51ae7c84304b4..5c09cd740cefc92b442ed4dcff59733e6c310aa6 100644 (file)
@@ -1,3 +1,21 @@
+# == Schema Information
+#
+# Table name: current_way_nodes
+#
+#  way_id      :integer          not null, primary key
+#  node_id     :integer          not null
+#  sequence_id :integer          not null, primary key
+#
+# Indexes
+#
+#  current_way_nodes_node_idx  (node_id)
+#
+# Foreign Keys
+#
+#  current_way_nodes_id_fkey       (way_id => current_ways.id)
+#  current_way_nodes_node_id_fkey  (node_id => current_nodes.id)
+#
+
 class WayNode < ActiveRecord::Base
   self.table_name = "current_way_nodes"
   self.primary_keys = "way_id", "sequence_id"
 class WayNode < ActiveRecord::Base
   self.table_name = "current_way_nodes"
   self.primary_keys = "way_id", "sequence_id"
index 99d435d33a7d78dec9e00af3f38d263d57b2cfc5..8ef75f38e21698b99bb24b63e2cce6d6f0def5e1 100644 (file)
@@ -1,3 +1,16 @@
+# == Schema Information
+#
+# Table name: current_way_tags
+#
+#  way_id :integer          not null, primary key
+#  k      :string           default(""), not null, primary key
+#  v      :string           default(""), not null
+#
+# Foreign Keys
+#
+#  current_way_tags_id_fkey  (way_id => current_ways.id)
+#
+
 class WayTag < ActiveRecord::Base
   self.table_name = "current_way_tags"
   self.primary_keys = "way_id", "k"
 class WayTag < ActiveRecord::Base
   self.table_name = "current_way_tags"
   self.primary_keys = "way_id", "k"
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake
new file mode 100644 (file)
index 0000000..4bca64f
--- /dev/null
@@ -0,0 +1,48 @@
+# 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.development?
+  task :set_annotation_options 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