Releases: evilmartians/evil-seed
Releases · evilmartians/evil-seed
0.7.0: New config syntax, custom scopes on associations, …
Added
-
Options to exclude all
has_many
andhas_one
or optionalbelongs_to
associations by default. [@Envek]root.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
-
Association limits also can be specified as hashes and/or arrays. [@Envek]
config.root('Forum', featured: true) do |forum| forum.limit_associations_size(15, questions: %i[answers votes]) end
Which is equivalent to:
config.root('Forum', featured: true) do |forum| forum.limit_associations_size(15, 'forum.questions.answers') forum.limit_associations_size(15, 'forum.questions.votes') 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
Fixed
- Error when dumping single-column tables. [@lsantobuono]
- 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. - Ignored columns handling.
- Dump relations for records that were dumped earlier with relations excluded.