jennifer v0.11.0 Release Notes
Release Date: 2021-07-20 // almost 3 years ago-
General
- โ add crystal
>= 1.0.0
support - ๐ fix inconsistent method signatures in multiple places
- โ add
#to_json
to the following structs:PG::Numeric
,PG::Geo::Point
,PG::Geo::Line
,PG::Geo::Circle
,PG::Geo::LineSegment
,PG::Geo::Box
,PG::Geo::Path
,PG::Geo::Polygon
,Char
,Time::Span
,Slice
,UUID
- โ add
crystal-mysql: 0.13.0
support - โ add
crystal-pg: 0.23.2
support
QueryBuilder
- โ add custom
#to_json
to serialize retrieved collection - โ add
#where
acceptingHash(Symbol, _)
- โ add
Criteria#equal
andCriteria#not_equal
as original implementation ofCriteria#==
andCriteria#!=
- โ add
ExpressionBuilder
#and
,#or
and#xor
methods that accepts array of conditions
Model
Authentication#password
returns given unecrypted value- โ add
Coercer
module with static methods to localize all coercing logic for different types - โ add
.coercer
method to return object responding to all coercing methods described inCoercer
mapping
generates.coerce_{{attribute}(value : String)
methods for every field to coerce string value toattribute
's typemapping
generates for every non-string attribute with a setter additional#{{attribute}}=(value : String)
setter- ๐ allow all build methods (
.new
,.create
and.update
) to receiveHash(String, String)
and coerce values to expected types - โ add
.column_name
to return all field names - ๐ fix
.field_names
from returning child's properties for parent class - โ add custom
#to_json
- change converter interface to
.from_db(DB::ResultSet, NamedTuple)
,.from_db(DB::ResultSet, NamedTuple)
and.from_hash(Hash, String | Symbol, NamedTuple)
- ๐ change all existing converters to support new required interface
- โ add
BigDecimalConverter(T)
converter - โ add
Coercer.coerce(String, (BigDecimal?).class)
- add
time_zone_aware
option forTimeZoneConverter
to specify whether field should respect time zone converting logic - โ add support of date only and time only string formats for
TimeZoneConverter
- add
time_format
,date_time_format
anddate_format
to customize time, date time and date formats respectively - ๐ fix a bug where updated_at is not set in the generated sql query from model.save
NumericToFloat64Converter
,BigDecimalConverter
,TimeZoneConverter
#from_hash
accepts string as field valueBigDecimalConverter#from_hash
accepts integer and float values as field value- ๐ fix
Errors#inspect
bug using oldUInt64#to_s
signature - introduce
Timestamp
module that now includeswith_timestamps
macro - reworked how
updated_at
andcreated_at
fields are set before save - now they are set explicitly without utilizing callbacks - โ add
Resource.where
acceptingHash(Symbol, _)
Validation
- ๐ change
Validator#validate
abstract interface to#validate(record, **opts)
- โก๏ธ update all built-in validators to reflect new
Validator
interface - make
Validator.with_blank_validation
macro to accept arguments to reference record, field name, value and blank value acceptance
Relation
- remove abstract
#condition_clause
&#condition_clause(a)
declarations fromIRelation
View
- โ add custom
#to_json
Adapter
- โ remove abstract
#update
declaration fromBase
BaseSQLGenerator#parse_query
convertsTime
arguments to UTC only ifConfig.time_zone_aware_attributes
set totrue
Mysql#read_column
callssuper
if column isn't a tiny intResultParser#read_column
convert time toConfig.local_time_zone
ifConfig.time_zone_aware_attributes
set totrue
or just change time zone to it otherwise
Config
.reset_config
creates new instance instead of executing#initialize
on existing object- add
Config.time_zone_aware_attributes
to specify whether time zone converting logic should be globally disabled
Migration
- โ add
precision
andscale
options support fordecimal
data type
Record
- โ add custom
#to_json
- โ add custom
#inspect
- โ add crystal