Skip to content

v0.4.4

Compare
Choose a tag to compare
@jwoertink jwoertink released this 26 Jun 20:09
· 24 commits to master since this release
9e71caf

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.