All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Options to exclude all
has_many
andhas_one
or optionalbelongs_to
associations by default. @Envekroot.exclude_has_relations root.exclude_optional_belongs_to
Excluded associations can be re-included by
include
with matching pattern. -
Exclusion and inclusion patterns can be specified as hashes and/or arrays. @Envek
config.root('Forum', featured: true) do |forum| forum.include(parent: {questions: %i[answers votes]}) end
Which is equivalent to:
config.root('Forum', featured: true) do |forum| forum.include(/\Aforum(\.parent(\.questions(\.answers))?)?)?\z/) forum.include(/\Aforum(\.parent(\.questions(\.votes))?)?)?\z/) end
-
Print reason of association exclusion or inclusion in verbose mode. @Envek
-
Allow to apply custom scoping to included associations. @Envek
config.root('Forum', featured: true) do |forum| forum.include('questions.answers') do order(created_at: :desc) end end
- Bug with null foreign key to back to auxiliary
has_one
association with not matching names. E.g. user has many profiles and has one default profile, profile belongs to user.
- Association inclusion option. @gazay (#13)
- Option to limit association depth. @gazay (#13)
- Option to ignore
default_scope
in models. @gazay (#13) - Option to disable nullifying of foreign keys. @gazay (#13)
- Passing attribute value to anonymizer block (to partially modify it). @Envek
- Ignore virtual ActiveRecord attributes. @Envek
- Support for ActiveRecord 4.2
- Compatibility with Ruby 3.0 and ActiveRecord 6.x.
- Bug with unwanted pseudo columns in dump when dumping HABTM join table without one side.
- ActiveRecord 4.2 support by backporting of
ActiveRecord::Relation#in_batches
- Dumping of the whole model without constraints