models: drop unnecessary presence validations.
In rails 5, belongs_to associations automatically validate that the associated item is present, meaning that we don't need to validate these things manually any more.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class UserNameChangeRequest < ApplicationRecord
|
||||
after_initialize :initialize_attributes, if: :new_record?
|
||||
validates_presence_of :user_id, :original_name, :desired_name
|
||||
validates_presence_of :original_name, :desired_name
|
||||
validates_inclusion_of :status, :in => %w(pending approved rejected)
|
||||
belongs_to :user
|
||||
belongs_to :approver, :class_name => "User", optional: true
|
||||
|
||||
Reference in New Issue
Block a user