Class: Marty::Config::ConfigValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/models/marty/config.rb

Instance Method Summary collapse

Instance Method Details

#validate(entry) ⇒ Object



3
4
5
6
7
# File 'app/models/marty/config.rb', line 3

def validate(entry)
  v = entry.get_value
  entry.errors[:base] << 'bad JSON value' if v.nil?
  v
end