Class: Pulitzer::ContentElementValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/validators/pulitzer/content_element_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordObject

Returns the value of attribute record.



3
4
5
# File 'app/validators/pulitzer/content_element_validator.rb', line 3

def record
  @record
end

Instance Method Details

#validate(record) ⇒ Object



5
6
7
8
9
# File 'app/validators/pulitzer/content_element_validator.rb', line 5

def validate(record)
  self.record = record
  validate_label_presence
  validate_lable_uniqueness if record.ensure_unique
end