clear v0.6 Release Notes
Release Date: 2019-02-25 // about 5 years ago-
v0.6
v0.6 should have shipped polymorphic relations, spec rework and improvement in
๐ documentation. That's a lot of work (honestly the biggest improvement since v0)
๐ and since already a lot of stuff have been integrated, I think it's better to
๐ ship now and prepare it for the next release.๐ Since few weeks I'm using Clear in a full-time project, so I can see and correct
many bugs. Clear should now be more stable in term of compilation and should not
crash the compiler (which happened in some borderline cases).๐ Features
๐ Release of a guide and documentation to use Clear: https://clear.gitbook.io/project/
json = JSON.parse(%({"first\_name": "John", "last\_name": "Doe", "tags": ["customer", "medical"] })) User.new(json)
โ Add of
pluck
andpluck_col
methods to retrieve one or multiple column in a Tuple,
which are super super fast and convenient!โ Add
Clear.with_cli
method to allow to use the CLI in your project. Check the documentation !โ Additional comments in the source code
SelectQuery
now inherits fromEnumerable(Hash(String, Clear::SQL::Any))
โ Add optional block on
Enum
definition. This allow you to define custom methods for the enum:Clear.enum ClientType, "company", "non\_profit", "personnal" dodef pay\_vat? self == Personnalendend
โ Add
?
support inraw
method:a = 1 b = 1000 c = 2 where{ raw("generate\_series(?, ?, ?)", a, b, c) }
[EXPERIMENTAL] Add
<<
operation on collection which comes fromhas_many
andhas_many through:
[EXPERIMENTAL] Add
unlink
method on collection which comes fromhas_many through:
[EXPERIMENTAL] Add possibility to create model from JSON:
๐ฅ Breaking changes
- ๐ Migration: use of
table.column
instead oftable.${type}
(remove the method missing method); this was causing headache
in some case where the syntax wasn't exactly followed, as the error output from the compiler was unclear. - Renaming of
with_serial_pkey
toprimary_key
; refactoring of the macro-code allowing to add other type of keys. - Now allow
text
,int
andbigint
primary key, with still theuuid
,serial
andbigserial
primary keys available. - Renaming of
Clear::Model::InvalidModelError
toClear::Model::InvalidError
andClear::Model::ReadOnlyError
to
Clear::Model::ReadOnly
to simplify as those classes are already in theClear::Model
namespace - ๐
Model#set
methods has been transfered toModel#reset
, andModel#set
now change the status of the column to dirty. (see #81)
๐ Bug fixes
- ๐ Migration: use of