Merge remote-tracking branch 'upstream/pull/3482'
This commit is contained in:
commit
73426ea383
22 changed files with 16 additions and 33 deletions
|
@ -183,11 +183,6 @@ Rails/OutputSafety:
|
|||
- 'lib/rich_text.rb'
|
||||
- 'test/helpers/application_helper_test.rb'
|
||||
|
||||
# Offense count: 23
|
||||
# Cop supports --auto-correct.
|
||||
Rails/RedundantPresenceValidationOnBelongsTo:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 90
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
|
|
|
@ -44,8 +44,6 @@ class Changeset < ApplicationRecord
|
|||
|
||||
validates :id, :uniqueness => true, :presence => { :on => :update },
|
||||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :user_id, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :num_changes, :presence => true,
|
||||
:numericality => { :only_integer => true,
|
||||
:greater_than_or_equal_to => 0 }
|
||||
|
|
|
@ -25,8 +25,8 @@ class ChangesetComment < ApplicationRecord
|
|||
|
||||
validates :id, :uniqueness => true, :presence => { :on => :update },
|
||||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :changeset, :presence => true, :associated => true
|
||||
validates :author, :presence => true, :associated => true
|
||||
validates :changeset, :associated => true
|
||||
validates :author, :associated => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
validates :body, :characters => true
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class ChangesetTag < ApplicationRecord
|
|||
|
||||
belongs_to :changeset
|
||||
|
||||
validates :changeset, :presence => true, :associated => true
|
||||
validates :changeset, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => :changeset_id }
|
||||
end
|
||||
|
|
|
@ -25,6 +25,4 @@ class IssueComment < ApplicationRecord
|
|||
belongs_to :user
|
||||
|
||||
validates :body, :presence => true, :characters => true
|
||||
validates :user, :presence => true
|
||||
validates :issue, :presence => true
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ class Message < ApplicationRecord
|
|||
belongs_to :recipient, :class_name => "User", :foreign_key => :to_user_id
|
||||
|
||||
validates :title, :presence => true, :utf8 => true, :length => 1..255
|
||||
validates :body, :sent_on, :sender, :recipient, :presence => true
|
||||
validates :body, :sent_on, :presence => true
|
||||
validates :title, :body, :characters => true
|
||||
|
||||
def self.from_mail(mail, from, to)
|
||||
|
|
|
@ -49,8 +49,6 @@ class Node < ApplicationRecord
|
|||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :version, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :changeset_id, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :latitude, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :longitude, :presence => true,
|
||||
|
|
|
@ -17,7 +17,7 @@ class NodeTag < ApplicationRecord
|
|||
|
||||
belongs_to :node
|
||||
|
||||
validates :node, :presence => true, :associated => true
|
||||
validates :node, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => :node_id }
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ class NoteComment < ApplicationRecord
|
|||
|
||||
validates :id, :uniqueness => true, :presence => { :on => :update },
|
||||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :note, :presence => true, :associated => true
|
||||
validates :note, :associated => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
validates :author, :associated => true
|
||||
validates :event, :inclusion => %w[opened closed reopened commented hidden]
|
||||
|
|
|
@ -35,7 +35,7 @@ class OldNode < ApplicationRecord
|
|||
# the queries generated by Redactable will use the wrong table name.
|
||||
include Redactable
|
||||
|
||||
validates :changeset, :presence => true, :associated => true
|
||||
validates :changeset, :associated => true
|
||||
validates :latitude, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :longitude, :presence => true,
|
||||
|
|
|
@ -18,7 +18,7 @@ class OldNodeTag < ApplicationRecord
|
|||
|
||||
belongs_to :old_node, :foreign_key => [:node_id, :version]
|
||||
|
||||
validates :old_node, :presence => true, :associated => true
|
||||
validates :old_node, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => [:node_id, :version] }
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ class OldRelation < ApplicationRecord
|
|||
has_many :old_members, -> { order(:sequence_id) }, :class_name => "OldRelationMember", :foreign_key => [:relation_id, :version]
|
||||
has_many :old_tags, :class_name => "OldRelationTag", :foreign_key => [:relation_id, :version]
|
||||
|
||||
validates :changeset, :presence => true, :associated => true
|
||||
validates :changeset, :associated => true
|
||||
validates :timestamp, :presence => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class OldRelationTag < ApplicationRecord
|
|||
|
||||
belongs_to :old_relation, :foreign_key => [:relation_id, :version]
|
||||
|
||||
validates :old_relation, :presence => true, :associated => true
|
||||
validates :old_relation, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => [:relation_id, :version] }
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ class OldWay < ApplicationRecord
|
|||
has_many :old_nodes, :class_name => "OldWayNode", :foreign_key => [:way_id, :version]
|
||||
has_many :old_tags, :class_name => "OldWayTag", :foreign_key => [:way_id, :version]
|
||||
|
||||
validates :changeset, :presence => true, :associated => true
|
||||
validates :changeset, :associated => true
|
||||
validates :timestamp, :presence => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class OldWayTag < ApplicationRecord
|
|||
|
||||
belongs_to :old_way, :foreign_key => [:way_id, :version]
|
||||
|
||||
validates :old_way, :presence => true, :associated => true
|
||||
validates :old_way, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => [:way_id, :version] }
|
||||
end
|
||||
|
|
|
@ -39,8 +39,6 @@ class Relation < ApplicationRecord
|
|||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :version, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :changeset_id, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :timestamp, :presence => true
|
||||
validates :changeset, :associated => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
|
|
|
@ -17,7 +17,7 @@ class RelationTag < ApplicationRecord
|
|||
|
||||
belongs_to :relation
|
||||
|
||||
validates :relation, :presence => true, :associated => true
|
||||
validates :relation, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => :relation_id }
|
||||
end
|
||||
|
|
|
@ -25,8 +25,6 @@ class Report < ApplicationRecord
|
|||
belongs_to :issue, :counter_cache => true
|
||||
belongs_to :user
|
||||
|
||||
validates :issue, :presence => true
|
||||
validates :user, :presence => true
|
||||
validates :details, :presence => true, :characters => true
|
||||
validates :category, :presence => true
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Trace < ApplicationRecord
|
|||
has_one_attached :image, :service => Settings.trace_image_storage
|
||||
has_one_attached :icon, :service => Settings.trace_icon_storage
|
||||
|
||||
validates :user, :presence => true, :associated => true
|
||||
validates :user, :associated => true
|
||||
validates :name, :presence => true, :length => 1..255, :characters => true
|
||||
validates :description, :presence => { :on => :create }, :length => 1..255, :characters => true
|
||||
validates :timestamp, :presence => true
|
||||
|
|
|
@ -16,6 +16,6 @@ class UserPreference < ApplicationRecord
|
|||
|
||||
belongs_to :user
|
||||
|
||||
validates :user, :presence => true, :associated => true
|
||||
validates :user, :associated => true
|
||||
validates :k, :v, :length => 1..255, :characters => true
|
||||
end
|
||||
|
|
|
@ -41,8 +41,6 @@ class Way < ApplicationRecord
|
|||
:numericality => { :on => :update, :only_integer => true }
|
||||
validates :version, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :changeset_id, :presence => true,
|
||||
:numericality => { :only_integer => true }
|
||||
validates :timestamp, :presence => true
|
||||
validates :changeset, :associated => true
|
||||
validates :visible, :inclusion => [true, false]
|
||||
|
|
|
@ -17,7 +17,7 @@ class WayTag < ApplicationRecord
|
|||
|
||||
belongs_to :way
|
||||
|
||||
validates :way, :presence => true, :associated => true
|
||||
validates :way, :associated => true
|
||||
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
|
||||
validates :k, :uniqueness => { :scope => :way_id }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue