Naming/UncommunicativeMethodParamName:
Enabled: false
-Rails/ApplicationRecord:
- Enabled: false
-
Rails/CreateTableWithTimestamps:
Enabled: false
# index_acls_on_mx (mx)
#
-class Acl < ActiveRecord::Base
+class Acl < ApplicationRecord
validates :k, :presence => true
def self.match(address, options = {})
--- /dev/null
+class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+end
# changesets_user_id_fkey (user_id => users.id)
#
-class Changeset < ActiveRecord::Base
+class Changeset < ApplicationRecord
require "xml/libxml"
belongs_to :user, :counter_cache => true
# changeset_comments_changeset_id_fkey (changeset_id => changesets.id)
#
-class ChangesetComment < ActiveRecord::Base
+class ChangesetComment < ApplicationRecord
belongs_to :changeset
belongs_to :author, :class_name => "User"
# changeset_tags_id_fkey (changeset_id => changesets.id)
#
-class ChangesetTag < ActiveRecord::Base
+class ChangesetTag < ApplicationRecord
self.primary_keys = "changeset_id", "k"
belongs_to :changeset
# client_applications_user_id_fkey (user_id => users.id)
#
-class ClientApplication < ActiveRecord::Base
+class ClientApplication < ApplicationRecord
belongs_to :user
has_many :tokens, :class_name => "OauthToken", :dependent => :delete_all
has_many :access_tokens
# diary_comments_user_id_fkey (user_id => users.id)
#
-class DiaryComment < ActiveRecord::Base
+class DiaryComment < ApplicationRecord
belongs_to :user
belongs_to :diary_entry
# diary_entries_user_id_fkey (user_id => users.id)
#
-class DiaryEntry < ActiveRecord::Base
+class DiaryEntry < ApplicationRecord
belongs_to :user, :counter_cache => true
belongs_to :language, :foreign_key => "language_code"
# diary_entry_subscriptions_user_id_fkey (user_id => users.id)
#
-class DiaryEntrySubscription < ActiveRecord::Base
+class DiaryEntrySubscription < ApplicationRecord
self.primary_keys = "user_id", "diary_entry_id"
belongs_to :user
# friends_user_id_fkey (user_id => users.id)
#
-class Friendship < ActiveRecord::Base
+class Friendship < ApplicationRecord
self.table_name = "friends"
belongs_to :befriender, :class_name => "User", :foreign_key => :user_id
# issues_updated_by_fkey (updated_by => users.id)
#
-class Issue < ActiveRecord::Base
+class Issue < ApplicationRecord
belongs_to :reportable, :polymorphic => true
belongs_to :reported_user, :class_name => "User", :foreign_key => :reported_user_id
belongs_to :user_resolved, :class_name => "User", :foreign_key => :resolved_by
# issue_comments_user_id_fkey (user_id => users.id)
#
-class IssueComment < ActiveRecord::Base
+class IssueComment < ApplicationRecord
belongs_to :issue
belongs_to :user
# native_name :string
#
-class Language < ActiveRecord::Base
+class Language < ApplicationRecord
self.primary_key = "code"
has_many :diary_entries, :foreign_key => "language"
# messages_to_user_id_fkey (to_user_id => users.id)
#
-class Message < ActiveRecord::Base
+class Message < ApplicationRecord
belongs_to :sender, :class_name => "User", :foreign_key => :from_user_id
belongs_to :recipient, :class_name => "User", :foreign_key => :to_user_id
# current_nodes_changeset_id_fkey (changeset_id => changesets.id)
#
-class Node < ActiveRecord::Base
+class Node < ApplicationRecord
require "xml/libxml"
include GeoRecord
# current_node_tags_id_fkey (node_id => current_nodes.id)
#
-class NodeTag < ActiveRecord::Base
+class NodeTag < ApplicationRecord
self.table_name = "current_node_tags"
self.primary_keys = "node_id", "k"
# notes_updated_at_idx (updated_at)
#
-class Note < ActiveRecord::Base
+class Note < ApplicationRecord
include GeoRecord
has_many :comments, -> { left_joins(:author).where(:visible => true, :users => { :status => [nil, "active", "confirmed"] }).order(:created_at) }, :class_name => "NoteComment", :foreign_key => :note_id
# note_comments_note_id_fkey (note_id => notes.id)
#
-class NoteComment < ActiveRecord::Base
+class NoteComment < ApplicationRecord
belongs_to :note, :foreign_key => :note_id, :touch => true
belongs_to :author, :class_name => "User", :foreign_key => :author_id
# 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
+class OauthNonce < ApplicationRecord
validates :timestamp, :presence => true
validates :nonce, :presence => true, :uniqueness => { :scope => :timestamp }
# oauth_tokens_user_id_fkey (user_id => users.id)
#
-class OauthToken < ActiveRecord::Base
+class OauthToken < ApplicationRecord
belongs_to :client_application
belongs_to :user
# nodes_redaction_id_fkey (redaction_id => redactions.id)
#
-class OldNode < ActiveRecord::Base
+class OldNode < ApplicationRecord
include GeoRecord
include ConsistencyValidations
include ObjectMetadata
# node_tags_id_fkey (node_id => nodes.node_id)
#
-class OldNodeTag < ActiveRecord::Base
+class OldNodeTag < ApplicationRecord
self.table_name = "node_tags"
self.primary_keys = "node_id", "version", "k"
# relations_redaction_id_fkey (redaction_id => redactions.id)
#
-class OldRelation < ActiveRecord::Base
+class OldRelation < ApplicationRecord
include ConsistencyValidations
include ObjectMetadata
# relation_members_id_fkey (relation_id => relations.relation_id)
#
-class OldRelationMember < ActiveRecord::Base
+class OldRelationMember < ApplicationRecord
self.table_name = "relation_members"
self.primary_keys = "relation_id", "version", "sequence_id"
# relation_tags_id_fkey (relation_id => relations.relation_id)
#
-class OldRelationTag < ActiveRecord::Base
+class OldRelationTag < ApplicationRecord
self.table_name = "relation_tags"
self.primary_keys = "relation_id", "version", "k"
# ways_redaction_id_fkey (redaction_id => redactions.id)
#
-class OldWay < ActiveRecord::Base
+class OldWay < ApplicationRecord
include ConsistencyValidations
include ObjectMetadata
# way_nodes_id_fkey (way_id => ways.way_id)
#
-class OldWayNode < ActiveRecord::Base
+class OldWayNode < ApplicationRecord
self.table_name = "way_nodes"
self.primary_keys = "way_id", "version", "sequence_id"
# way_tags_id_fkey (way_id => ways.way_id)
#
-class OldWayTag < ActiveRecord::Base
+class OldWayTag < ApplicationRecord
self.table_name = "way_tags"
self.primary_keys = "way_id", "version", "k"
# record's title and description fields, which can be
# displayed linked from the redacted records.
#
-class Redaction < ActiveRecord::Base
+class Redaction < ApplicationRecord
belongs_to :user
has_many :old_nodes
# current_relations_changeset_id_fkey (changeset_id => changesets.id)
#
-class Relation < ActiveRecord::Base
+class Relation < ApplicationRecord
require "xml/libxml"
include ConsistencyValidations
# current_relation_members_id_fkey (relation_id => current_relations.id)
#
-class RelationMember < ActiveRecord::Base
+class RelationMember < ApplicationRecord
self.table_name = "current_relation_members"
self.primary_keys = "relation_id", "sequence_id"
# current_relation_tags_id_fkey (relation_id => current_relations.id)
#
-class RelationTag < ActiveRecord::Base
+class RelationTag < ApplicationRecord
self.table_name = "current_relation_tags"
self.primary_keys = "relation_id", "k"
# reports_user_id_fkey (user_id => users.id)
#
-class Report < ActiveRecord::Base
+class Report < ApplicationRecord
belongs_to :issue, :counter_cache => true
belongs_to :user
# gpx_files_user_id_fkey (user_id => users.id)
#
-class Trace < ActiveRecord::Base
+class Trace < ApplicationRecord
self.table_name = "gpx_files"
belongs_to :user, :counter_cache => true
# gps_points_gpx_id_fkey (gpx_id => gpx_files.id)
#
-class Tracepoint < ActiveRecord::Base
+class Tracepoint < ApplicationRecord
include GeoRecord
self.table_name = "gps_points"
# gpx_file_tags_gpx_id_fkey (gpx_id => gpx_files.id)
#
-class Tracetag < ActiveRecord::Base
+class Tracetag < ApplicationRecord
self.table_name = "gpx_file_tags"
belongs_to :trace, :foreign_key => "gpx_id"
# users_home_idx (home_tile)
#
-class User < ActiveRecord::Base
+class User < ApplicationRecord
require "xml/libxml"
self.ignored_columns = ["nearby"]
# user_blocks_user_id_fkey (user_id => users.id)
#
-class UserBlock < ActiveRecord::Base
+class UserBlock < ApplicationRecord
validate :moderator_permissions
validates :reason, :characters => true
# user_preferences_user_id_fkey (user_id => users.id)
#
-class UserPreference < ActiveRecord::Base
+class UserPreference < ApplicationRecord
self.primary_keys = "user_id", "k"
belongs_to :user
# user_roles_user_id_fkey (user_id => users.id)
#
-class UserRole < ActiveRecord::Base
+class UserRole < ApplicationRecord
belongs_to :user
belongs_to :granter, :class_name => "User"
# user_tokens_user_id_fkey (user_id => users.id)
#
-class UserToken < ActiveRecord::Base
+class UserToken < ApplicationRecord
belongs_to :user
after_initialize :set_defaults
# current_ways_changeset_id_fkey (changeset_id => changesets.id)
#
-class Way < ActiveRecord::Base
+class Way < ApplicationRecord
require "xml/libxml"
include ConsistencyValidations
# current_way_nodes_node_id_fkey (node_id => current_nodes.id)
#
-class WayNode < ActiveRecord::Base
+class WayNode < ApplicationRecord
self.table_name = "current_way_nodes"
self.primary_keys = "way_id", "sequence_id"
# current_way_tags_id_fkey (way_id => current_ways.id)
#
-class WayTag < ActiveRecord::Base
+class WayTag < ApplicationRecord
self.table_name = "current_way_tags"
self.primary_keys = "way_id", "k"