- Bug fix
- Fixed
diverged_changeset/2
to properly calculate default values
- Fixed
- Bug fix
- Fixed definition of fields in diverged schema to allow more complex relationships definitions
-
Enhancements
- You can transform diverged schema to its base by calling
DivergedSchema.to_base(%DivergedSchema{})
- You can transform diverged schema to its base by calling
-
Bug fix
- Fixed
__meta__[:state]
for entities loaded from DB
- Fixed
- Bug fix
- Fixed situations where
diverged_changeset/2
was returning incorrect owners of relationships
- Fixed situations where
-
Enhancements
- You can get list of all diverged schemas by calling
BaseSchema.__schema__(:diverged)
- You can get list of all diverged schemas by calling
-
Bug fix
- Fixed situations where
diverged_changeset/2
may have been receiving different structs
- Fixed situations where
-
Enhancements
- Added support for inheritance of
@derive
. Now you don't have to duplicate declarations for things likeJason.Encoder
- Added support for inheritance of
-
Bug fix
- Fixed value of
__meta__
after runningdiverged_changeset/2
- Fixed value of
- Breaking changes
- Renamed
EctoDiscriminator.DiscriminatorSchema
toEctoDiscriminator.DiscriminatorChangeset
since it focuses on adding extra functionality to the changesets rather than schemas
- Renamed
- Bug fix
- Fixed usage of macros inside
schema
definition
- Fixed usage of macros inside
- Enhancements
- Discriminator can now be a
virtual
field. This is useful when table is referenced by other table(s)
- Discriminator can now be a
- Enhancements
- Discriminator field name inside
diverged_changeset/2
can be now determined from struct/changeset field - Overriden fields with matching types will have their options merged
- Discriminator field name inside
- Bug fix
- Changed way how
DiscriminatorChangeset
is used. It should be more flexible now. Previously sometimes the changes weren't properly reflected
- Changed way how
- Bug fix
- Fixed
diverged_changeset/2
default implementation. Previous logic wasn't creating proper diverged struct.
- Fixed
- Enhancements
- Added documentation for the project
cast_base/3
now won't return changes for overriden fields due to possible type differences.
- Enhancements
- Major refactor of
EctoDiscriminator.Schema
- Major refactor of