Module: Mongo::Model::Validation
- Defined in:
- lib/mongo/model/validation.rb
Instance Method Summary collapse
-
#create_object(*args) ⇒ Object
Catching erros during CRUD and adding it to errors, like unique index.
- #delete_object(*args) ⇒ Object
- #invalid?(options = {}) ⇒ Boolean
- #update_object(*args) ⇒ Object
- #valid?(options = {}) ⇒ Boolean
Instance Method Details
#create_object(*args) ⇒ Object
Catching erros during CRUD and adding it to errors, like unique index.
10 11 12 13 14 |
# File 'lib/mongo/model/validation.rb', line 10 def create_object *args with_exceptions_as_errors do super end end |
#delete_object(*args) ⇒ Object
22 23 24 25 26 |
# File 'lib/mongo/model/validation.rb', line 22 def delete_object *args with_exceptions_as_errors do super end end |
#invalid?(options = {}) ⇒ Boolean
6 |
# File 'lib/mongo/model/validation.rb', line 6 def invalid?( = {}); !valid?() end |
#update_object(*args) ⇒ Object
16 17 18 19 20 |
# File 'lib/mongo/model/validation.rb', line 16 def update_object *args with_exceptions_as_errors do super end end |
#valid?(options = {}) ⇒ Boolean
2 3 4 5 |
# File 'lib/mongo/model/validation.rb', line 2 def valid? = {} errors.clear run_validations end |