Class: Hyrax::CollectionMembershipValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/validators/hyrax/collection_membership_validator.rb

Overview

Validates that the record passes the multiple membership checker

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object


5
6
7
8
9
10
# File 'app/validators/hyrax/collection_membership_validator.rb', line 5

def validate(record)
  update_collections(record)
  validation = validate_multi_membership(record)
  return if validation == true
  record.errors[:member_of_collection_ids] << validation
end