v0.4.4
This release adds a new validation
option to your settings.
Habitat.create do
setting pin : String, validation: :validate_pin_format
end
def self.validate_pin_format(value : String)
value.match(your_special_format) || Habitat.raise_validation_error("Nope.. try again")
end
We have also renamed the Settings
class to HabitatSettings
for less chance of naming conflicts in your apps. Lastly, this release will now catch your default value if it raises an exception.