There's no need for us to have it when rails does this for us.
- '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.
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 }
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
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
belongs_to :user
validates :body, :presence => true, :characters => true
- validates :user, :presence => true
- validates :issue, :presence => true
end
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)
: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,
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
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]
# 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,
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
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]
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
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]
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
: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]
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
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
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
belongs_to :user
- validates :user, :presence => true, :associated => true
+ validates :user, :associated => true
validates :k, :v, :length => 1..255, :characters => true
end
: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]
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