Relation#map_to
available in repository relations to ease upgrade to rom 4.0 (solnic)- Deprecation warnings in preparation for rom 4.0 release (solnic)
Changeset#extend
to exclude steps from the#diff
output, this allows to filter out timestamp changes prior to updates so that we can avoid hitting the database in case of timestamp-only changes. You still can call.map(:touch)
if you want to haveupdated_at
refreshed unconditionally (flash-gordon)
aggregate
andcombine
works correctly with nested graph options where associations are aliased (solnic)- Auto-mapping no longer creates intermediate struct objects for combined relations (which caused massive performance degradation in some cases) (solnic)
- Aliased associations no longer cause mapping to intermediate structs (solnic)
- Fix building changesets with relation using
Root#changeset
(flash-gordon) - Fix wrap when aliased relation is used (solnic)
- Fix accessing
data
in map block in changesets (flash-gordon+solnic)
- Calculate diff only with respect to keys present on the original tuple (yuszuv+solnic)
- Support for using custom mappers inside
#node
(flash-gordon)
- Updated
dry-initializer
(flash-gordon)
- Support for chaining
Changeset#associate
(solnic) - Inferring association name for
Changeset#associate
(solnic) - Support for restricting
Update
andDelete
changesets explicitly viaChangeset#by_pk
(solnic)
- Support for
#read
in rom-sql was restored via mapping toROM::OpenStruct
(solnic) - Using
#nodes
no longer executes redundant query with deeply nested aggregates (solnic)
- Depends on rom >= 3.1.0 now as it provides
Relation::Graph#with_nodes
which is needed here (solnic)
- Mapping to
ROM::Struct
can be disabled viaauto_struct
option (solnic) - You can now use custom mappers along with auto-mapping via
map_with(:my_mapper, auto_map: true)
(solnic) wrap
can be used along with association names ieusers.wrap(:address)
(solnic)#node
relation method that can be used to adjust graph nodes produced byaggregate
orcombine
(solnic)
- Structs raise nicer
NoMethodError
(flash-gordon) - Custom model set on a node relation is respected when loading aggregates (solnic)
- Structs uses read types for attributes so that they don't perform an unexpected serialization (flash-gordon)
Changeset::Update
creates a command with restricted relation (solnic)Changeset#result
will always return:many
for arrays and:one
for other objects (even when a custom object is used) (solnic)
- New
Repository#transaction
API for executing operations inside a database transaction (flash-gordon+solnic) aggregate
andcombine
support nested association specs, iecombine(users: [tasks: :tags])
(beauby)- Changesets support data as arrays too (solnic)
- Changesets support custom command types via
Changeset#with(command_type: :my_command)
(solnic) Changeset::Delete
was added and is accessible viarepo.changeset(delete: some_relation.by_pk(1))
(solnic)- Ability to define custom changeset classes that can be instantiated via
repo.changeset(MyChangesetClass[:rel_name]).data(some_data)
orroot_repo.changeset(MyChangesetClass)
whereMyChangesetClass
inherits from a core changeset class (solnic) Changeset.map
which accepts a block and exposes a DSL for data transformations (all transproc hash methods) are available (solnic)Changeset.map
which accepts a custom block that can transform data (executed in the context of a changeset object) (solnic)- Support for composing multiple mappings via
Changeset.map
(solnic) Changeset#associate
method that accepts another changeset or parent data and an association identifier, iepost_changeset.associate(user, :author)
(solnic)- Support for inferring typed structs based on relation schemas (solnic)
- You can now use
wrap_parent
in combined relations too (which is gazillion times faster thancombine_parents
) (solnic)
ROM::Struct
is now based onDry::Struct
(solnic)- rom-support dependency was removed (flash-gordon)
update?
andcreate?
methods were removed fromChangeset:*
subclasses (solnic)
Create
commands generated for aliased associations work correctly (solnic)Create
commands generated forbelongs_to
associations work correctly (solnic)- FKs are always included in auto-generated structs used in aggregates (solnic)
- Calling undefined methods on repo relations raises a nicer error (solnic)
Fixed gemspec so that we don't exclude all files with 'bin' in their name, geez (solnic)
Repository#command
for inferring commands automatically from relations (solnic)Repository.commands
macro which generates command methods (solnic)Repository[rel_name]
for setting up a repository with a root relation (solnic)Repository#aggregate
as a shortcut for composing relation graphs from root (solnic)Repository#changeset
API for building specialized objects for handling changes in relations (solnic)
- Auto-mapping includes default custom mapper for a given relation (AMHOL)
- When custom mapper is set, default struct mapper won't be used (AMHOL)
Relation#combine
supports passing name of configured associations for automatic relation composition (solnic)Repository
constructor simply expects a rom container, which makes it work with DI libs likedry-auto_inject
(solnic)- Depends on
rom 2.0.0
now (solnic) - Replace anima with
ROM::Repository::StructAttributes
(flash-gordon)
- You can now pass a custom class that will be used for mapping using
.as(MyClass)
interface (solnic)
- Relation plugins have been moved to
rom
androm-sql
. Other adapters can enable them too which means repository can now be used with any adapter (solnic) Repository::Base
is deprecated, just inherit fromROM::Repository
(solnic)
- Added
respond_to_missing?
toLoadingProxy
(AMHOL)
This release ensures that relations from different adapters can be composed together 🎉
- Plugins are registered correctly for multi-env setups (AMHOL)
- multi-block
view
syntax works correctly when header is not provided as options (solnic)
view
relation plugin (solnic)key_inference
relation plugin (solnic)base_view
sql relation plugin (solnic)auto_combine
sql relation plugin (solnic)auto_wrap
sql relation plugin (solnic)
- Switched to extracted
rom-mapper
gem (solnic)
First public release \o/
Relation#combine_parents
for auto-combine using eager-loading strategy aka relation composition (solnic)Relation#combine_children
for auto-combine using eager-loading strategy aka relation composition (solnic)Relation#wrap_parent
for auto-wrap using inner join (solnic)Relation.view
for explicit relation view definitions with header and query (solnic)- Auto-mapping feature which builds mappers that turn relations into simple structs (solnic)