Module: ConfigureMe::Validations
Instance Method Summary collapse
Instance Method Details
#save(options = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/configure_me/validations.rb', line 12 def save(={}) run_callbacks :validation do perform_validations() ? super : false end end |
#valid?(context = nil) ⇒ Boolean
18 19 20 21 22 |
# File 'lib/configure_me/validations.rb', line 18 def valid?(context = nil) context ||= (persisted? ? :update : :create) output = super(context) errors.empty? && output end |