Module: Ripple::Validations::ClassMethods
- Defined in:
- ripple/lib/ripple/validations.rb,
ripple/lib/ripple/validations/associated_validator.rb
Instance Method Summary (collapse)
-
- (Object) create!(attrs = {}, &block)
Instantiates a new document, applies attributes from a block, and saves it Raises Ripple::DocumentInvalid if the record did not save.
- - (Object) validates_associated(*attr_names)
Instance Method Details
- (Object) create!(attrs = {}, &block)
Instantiates a new document, applies attributes from a block, and saves it Raises Ripple::DocumentInvalid if the record did not save
53 54 55 56 |
# File 'ripple/lib/ripple/validations.rb', line 53 def create!(attrs={}, &block) obj = create(attrs, &block) (raise Ripple::DocumentInvalid.new(obj) if obj.new?) || obj end |
- (Object) validates_associated(*attr_names)
29 30 31 |
# File 'ripple/lib/ripple/validations/associated_validator.rb', line 29 def validates_associated(*attr_names) validates_with AssociatedValidator, _merge_attributes(attr_names) end |