- Introduces
mass_assignment_strict_mode
configuration option to control the behavior of mass assignment.- The setting is per class and configures strict handling of unknown attributes by raising an exception.
- By default it is disabled, and you need to opt-in.
- #32
- Fix crash when mapping PostgreSQL enum to ruby variable in #28
- Lower severity of the log message during mass assignment #26
- Support for ruby 3.2 by @konalegi in #22
- Fix deprecated #to_s method by @mpiask in #24
- Support for Rails 7.1 by @ojab in #25
- [BREAKING] Drop support for Rails < 6.0 by @ojab in #25
- [BREAKING] Drop support for taking
model
as first argument in default/readonly/enum/normalize. This means thatdefault: -> (model) { model.other_field}
is no longer supported and should be replaced withdefault: -> { other_field }
. - Add support for evaluating
Symbol
for readonly/enum/normalize. If symbol is passed in one of those options, method with that name will be called when evaluating the value. - [BREAKING] Remove
localized
attribute type. - [BREAKING] Change the behavior of
default
andnormalize
forcollection
&dictionary
. Instead of acting per element they will now act on the attribute as a whole.- E.g.
collection :numbers, default: [1, 2, 3]
will not set the default for the whole collection ofnumbers
rather than each element innumbers
.
- E.g.
- [BREAKING] Stop automatically saving
references_one
/references_many
when applying changes. - [BREAKING] Removed Lifecycle module.
embeds_many
/embeds_one
objects can no longer be created/saved/updated/destroyed. - [BREAKING] Due to changes above
accepts_nested_attributes_for
forembeds_many
/embeds_one
associations no longer marks objects for destruction but simply removes them, making changes instantly. - Drop support for ruby 2.3 and rails 4.2
- Replace typecasters with proper type definitions.
- Instead of
typecaster(type) { |value, _| ... }
you'll have to usetypecaster(type) { |value| ... }
. - Consequently you can access type definition in typecaster, e.g.
typecaster('Object') { |value| value if value.class < type }
, heretype
comes from type definition.
- Instead of
- Fixed represented error message copying when represented model uses symbols for
message
.
- Forked from ActiveData, see https://github.com/pyromaniac/active_data/blob/v1.2.0/CHANGELOG.md for changes before this