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:
@@ -6,7 +6,6 @@ class BulkUpdateRequest < ApplicationRecord
|
||||
belongs_to :forum_post, optional: true
|
||||
belongs_to :approver, optional: true, class_name: "User"
|
||||
|
||||
validates_presence_of :user
|
||||
validates_presence_of :script
|
||||
validates_presence_of :title, if: ->(rec) {rec.forum_topic_id.blank?}
|
||||
validates_inclusion_of :status, :in => %w(pending approved rejected)
|
||||
|
||||
Reference in New Issue
Block a user