Hanami::Model v0.7.0 Release Notes
Release Date: 2016-11-15 // over 7 years ago-
โ Added
- [Luca Guidi]
Hanami::Entity
defines an automatic schema for SQL databases โ [Luca Guidi]Hanami::Entity
attributes schema - ๐ [Luca Guidi] Experimental support for One-To-Many association (aka
has_many
) - ๐ [Luca Guidi] Native support for PostgreSQL types like UUID, Array, JSON(B) and Money
- [Luca Guidi] Repositories instances can access all the relations (eg.
BookRepository
can accessusers
relation via#users
) - [Luca Guidi] Automapping for SQL databases
- ๐ [Luca Guidi] Added
Hanami::Model::DatabaseError
๐ Changed
- [Luca Guidi] Entities are immutable
- ๐ [Luca Guidi] Removed support for Memory and File System adapters
- [Luca Guidi] Removed support for dirty tracking
- [Luca Guidi]
Hanami::Entity.attributes
method no longer accepts a list of attributes, but a block to optionally define typed attributes - ๐ [Luca Guidi] Removed
#fetch
,#execute
and#transaction
from repository - ๐ง [Luca Guidi] Removed
mapping
block fromHanami::Model.configure
- ๐ง [Luca Guidi] Changed
adapter
signature inHanami::Model.configure
(useadapter :sql, ENV['DATABASE_URL']
) - [Luca Guidi] Repositories must inherit from
Hanami::Repository
instead of including it - [Luca Guidi] Entities must inherit from
Hanami::Entity
instead of including it - [Pascal Betz] Repositories use instance level interface (eg.
BookRepository.new.find
instead ofBookRepository.find
) - [Luca Guidi] Repositories now accept hashes for CRUD operations
- [Luca Guidi]
Hanami::Repository#create
now accepts: hash (or entity) - โก๏ธ [Luca Guidi]
Hanami::Repository#update
now accepts two arguments: primary key (id
) and data (or entity) - [Luca Guidi]
Hanami::Repository#delete
now accepts: primary key (id
) - [Luca Guidi] Drop
Hanami::Model::NonPersistedEntityError
,Hanami::Model::InvalidMappingError
,Hanami::Model::InvalidCommandError
,Hanami::Model::InvalidQueryError
- ๐ [Luca Guidi] Official support for Ruby 2.3 and JRuby 9.0.5.0
- ๐ [Luca Guidi] Drop support for Ruby 2.0, 2.1, 2.2, and JRuby 9.0.0.0
- ๐ [Luca Guidi] Drop support for
mysql
gem in favor ofmysql2
๐ Fixed
- [Luca Guidi] Ensure booleans to be correctly dumped in database
- 0๏ธโฃ [Luca Guidi] Ensure to respect default database schema values
- โก๏ธ [Luca Guidi] Ensure SQL UPDATE to not override non-default primary key
- ๐จ [James Hamilton] Print appropriate error message when trying to create a PostgreSQL database that is already existing
- [Luca Guidi]