V1.3: v0.8.0
-
Use Ruby 2.2+
-
Edit your
Gemfile, by changing Hanami version:gem 'hanami', '~> 0.8'. -
Create a group
:developmentinGemfileand addgem 'shotgun' -
Create a group
:development, :testinGemfileand addgem 'dotenv', '~> 2.0' -
Edit
.hanamircby adding a new keyproject. The value must be the snake_case name of the project. Eg.project=active_citizens. -
Edit
.env.*files and change env variables from<PROJECT>_DATABASE_URLtoDATABASE_URL. -
Edit
lib/<project>.rband change theadapter -> uri:variable fromENV['<PROJECT>_DATABASE_URL']toENV['DATABASE_URL'] -
Change params validation syntax. Learn more at Hanami::Validations README.
-
Change params access syntax to symbols. Eg
params['book']is no longer supported. -
The returning value of
params.errorshas changed: now it’s a Hash with key the attribute name and value an array of strings with error messages. -
In views, layouts and templates use
#localinstead of#content, which is now deprecated. -
[Optional] Edit logging settings in
apps/web/application.rb. -
[Optional] Add
security.x_content_type_options 'nosniff'toapps/web/application.rb. -
[Optional] Add
security.x_xss_protection '1; mode=block'toapps/web/application.rb. -
[Optional] Add
subresource_integrity :sha256toassetsblock inconfigure :productiontoapps/web/application.rb. -
[Optional] Minitest users can disable Rake 11 warnings by adding
t.warning = falseto theRake::TestTask.new do |t|block inRakefile -
[Optional] RSpec users can disable Rake 11 warnings by adding
config.warnings = falseto theRSpec.configure |config|block inspec/spec_helper.rb.
If you have any problem, don’t hesitate to look for help in our forum.