Class: Pulitzer::ContentElementValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Pulitzer::ContentElementValidator
- Defined in:
- app/validators/pulitzer/content_element_validator.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
Instance Method Summary collapse
Instance Attribute Details
#record ⇒ Object
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 |