| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2021-07-21 | 4.8 kB | |
| Release 0.11.0.tar.gz | 2021-07-21 | 236.8 kB | |
| Release 0.11.0.zip | 2021-07-21 | 376.7 kB | |
| Totals: 3 Items | 618.3 kB | 0 | |
I'm happy to announce that the release supporting crystal >= 1.0.0 is published. Summarizing changelog below I'd like to emphasize next points:
- now models/views/record have
#to_jsonmethod to simplify serialization - Jennifer supports latest mysql/postgresl/sqlite driver versions
- now string-based values can be used much easily with new coercing logic
- time zone related logic become more flexible and configurable
- now each pull request merge and release automatically rebuilds documentation so you always can check fresh version here
- currently i18n shard has a bit unstable support so may cause some issues (feel free to open issue if you face one)
Changelog
General
- add crystal
>= 1.0.0support - fix inconsistent method signatures in multiple places
- add
#to_jsonto 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.0support - add
crystal-pg: 0.23.2support
QueryBuilder
- add custom
#to_jsonto serialize retrieved collection - add
#whereacceptingHash(Symbol, _) - add
Criteria#equalandCriteria#not_equalas original implementation ofCriteria#==andCriteria#!= - add
ExpressionBuilder#and,#orand#xormethods that accepts array of conditions
Model
Authentication#passwordreturns given unecrypted value- add
Coercermodule with static methods to localize all coercing logic for different types - add
.coercermethod to return object responding to all coercing methods described inCoercer mappinggenerates.coerce_{{attribute}(value : String)methods for every field to coerce string value toattribute's typemappinggenerates for every non-string attribute with a setter additional#{{attribute}}=(value : String)setter- allow all build methods (
.new,.createand.update) to receiveHash(String, String)and coerce values to expected types - add
.column_nameto return all field names - fix
.field_namesfrom 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_awareoption forTimeZoneConverterto 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_formatanddate_formatto 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_hashaccepts string as field valueBigDecimalConverter#from_hashaccepts integer and float values as field value- fix
Errors#inspectbug using oldUInt64#to_ssignature - introduce
Timestampmodule that now includeswith_timestampsmacro - reworked how
updated_atandcreated_atfields are set before save - now they are set explicitly without utilizing callbacks - add
Resource.whereacceptingHash(Symbol, _)
Validation
- change
Validator#validateabstract interface to#validate(record, **opts) - update all built-in validators to reflect new
Validatorinterface - make
Validator.with_blank_validationmacro 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
#updatedeclaration fromBase BaseSQLGenerator#parse_queryconvertsTimearguments to UTC only ifConfig.time_zone_aware_attributesset totrueMysql#read_columncallssuperif column isn't a tiny intResultParser#read_columnconvert time toConfig.local_time_zoneifConfig.time_zone_aware_attributesset totrueor just change time zone to it otherwise
Config
.reset_configcreates new instance instead of executing#initializeon existing object- add
Config.time_zone_aware_attributesto specify whether time zone converting logic should be globally disabled
Migration
- add
precisionandscaleoptions support fordecimaldata type
Record
- add custom
#to_json - add custom
#inspect