Hello wonderful community!
Today we're happy to announce
v1.1.0.beta2 release 🙌 , with the stable release (
v1.1.0) scheduled later this month.
So what's new and exiciting in the Hanami world?
We're starting to support Hanami plugins. Hanami plugins are gems that can integrate with Hanami projects.
The first thing plugins are be able to do is to provide custom CLI commands.
A developer that needs to use a plugin, can add it to the
:plugins group to the
# Gemfile # ... group :plugins do gem "hanami-reloader" end
hanami db rollback to rollback database migrations.
By default it rolls back the latest migration, but you can specify a number of steps to rollback:
bundle exec hanami db rollback # rolls back the last migration bundle exec hanami db rollback 5 # rolls back the last five migrations
It's now possible to add error messages to Action's params via
module Web::Controllers::User class Create include Web::Action params do required(:user).schema do required(:name).filled(:str?) required(:email).filled(:str?) end end def call(params) return unless params.valid? UserRepository.new.create(params[:user]) rescue Hanami::Model::UniqueConstraintViolationError params.errors.add(:email, "is not unique") end end end
We're grateful for each person who contributed to this release. These lovely people are:
- Alfonso Uceda
- Anton Davydov
- Gabriel Gizotti
- Luca Guidi
- Marcello Rocha
- Marion Duprey
- Marion Schleifer
- Oana Sipos
- Sean Collins
If you want to try with a new project:
gem install hanami --pre hanami new bookshelf
If you want to upgrade your existing project, edit the
# ... gem "hanami", "1.1.0.beta2" gem "hanami-model", "1.1.0.beta2"
We'll release the stable release later this month, in the meantime, please try this beta and report issues. Happy coding! 🌸