app/models/observation/media.rb
TODO found Open
Open
# TODO: Validate presence of at least one Descriptor (use same logic as AssertedDistribution)
- Exclude checks
TODO found Open
Open
# TODO: Validate absence of everything
- Exclude checks
Prefer the new style validations validates :column, uniqueness: value
over validates_uniqueness_of
. Open
Open
validates_uniqueness_of :descriptor_id, scope: [:observation_object_id, :observation_object_type], message: 'the observation already exists'
- Read upRead up
- Exclude checks
This cop checks for the use of old-style attribute validation macros.
Example:
# bad
validates_acceptance_of :foo
validates_confirmation_of :foo
validates_exclusion_of :foo
validates_format_of :foo
validates_inclusion_of :foo
validates_length_of :foo
validates_numericality_of :foo
validates_presence_of :foo
validates_absence_of :foo
validates_size_of :foo
validates_uniqueness_of :foo
# good
validates :foo, acceptance: true
validates :foo, confirmation: true
validates :foo, exclusion: true
validates :foo, format: true
validates :foo, inclusion: true
validates :foo, length: true
validates :foo, numericality: true
validates :foo, presence: true
validates :foo, absence: true
validates :foo, size: true
validates :foo, uniqueness: true