Skip to content

Releases: Alexander-Senko/adjustable_schema

v0.11.1

19 May 11:20
3632a35

Choose a tag to compare

Fixed

  • Associations setup for inherited models got broken in v0.11.0.

Full Changelog: v0.11.0...v0.11.1

v0.11.0

08 May 20:39
97db4b7

Choose a tag to compare

Changed

  • Deprecated Relationship.seed! in favor of AdjustableSchema.relationship!.
  • Special naming rules for “actor-like” models: switched from <associat>ful form to check for related records’ presence back to a passive one (<associat>ed). Thus, it’s authored and edited now instead of authorful and editful.
  • Relationship.to/.of handle STI classes precisely instead of falling back to a base class.
  • Customized inspections for Relationship.

Added

  • referencing/referenced_by scopes to filter by related records.
  • #referencing!/#referenced_by! setters to add related records.
  • Short-cut methods for related records. For example, authors association provides the following extras:
    • .authored_by scope to filter records by authors,
    • #authored_by? — to check if the record is authored by provided ones,
    • #authored_by! — to add an author.

Full Changelog: v0.10.0...v0.11.0

v0.10.0

23 Apr 12:23
4f67640

Choose a tag to compare

Changed

  • No more polymorphic STI associations tricks (see 0dd3022 for details).

Added

  • Special naming rules for “actor-like” models.

Full Changelog: v0.9.0...v0.10.0

v0.9.0

23 Apr 11:45
d048949

Choose a tag to compare

Changed

  • Requires Rails 8 and Ruby 3.4+.
  • Protected AdjustableSchema::Relationship::Role from being deleted when used.

Added

  • Relationship#sourced and Relationship#targeted scopes to filter relationships by presence of source and target records respectively.

Fixed

  • Relationship#applied scope used to return relationships with at least one record attached, instead of ones with both records present.

    Full Changelog: v0.8.0...v0.9.0

v0.8.0

08 Nov 14:11
bae5d9c

Choose a tag to compare

Changed

  • Renamed checks for related records:
    <associat>ful form is now used instead of a passive one (<associat>ed) to check for related records’ presence.
    • .<associat>ful — scope records having associated ones.
    • #<associat>ful? — are there any records associated?
  • Naming: improved passive forms for words ending with or/ant/ion/ment/ing.

Added

  • Checks for related records’ presence on roleless recursive associations:
    • .<associat>ful
      records having associated ones;
    • .<association>less
      records not having associated ones;
    • #<associat>ful?
      if there are records associated;
    • #<association>less?
      if there are no records associated;
    • #intermediate?
      whether is only one child record associated (Is the node just a link between two other nodes like?);
    • #branching?
      whether are several child records associated.

Fixed

  • Naming: passive form for author.

Full Changelog: v0.7.2...v0.8.0

v0.7.2

08 Nov 13:41
532832c

Choose a tag to compare

Fixed

  • roleless scope used to generate wrong queries.

Full Changelog: v0.7.1...v0.7.2

v0.7.1

08 Nov 13:41
d7f57e6

Choose a tag to compare

Fixed

  • DB constraints:
    • roles.name is NOT NULL,
    • UNIQUE constraints should treat NULLS as NOT DISTINCT.
  • Roleless recursive associations used to fail on joins.

Full Changelog: v0.7.0...v0.7.1

v0.7.0

08 Nov 13:40
f0fcea6

Choose a tag to compare

Changed

  • Naming: improved passive forms a bit.
  • Configuration: renamed self_related to self.

Added

  • Checks for related records’ presence:
    • .<associat>ed
      records having associated ones,
    • .<association>less
      records not having associated ones,
    • #<associat>ed?
      if there are records associated,
    • #<association>less?
      if there are no records associated.
  • Documentation: self-targeted relationships in README.

Fixed

  • Documentation: examples in the README.

Full Changelog: v0.6.0...v0.7.0

v0.6.0

08 Nov 13:39
a148ed1

Choose a tag to compare

Changed

  • Destroy orphaned relationships of an object on destroy.
  • Symbolize configurable names used for associations, methods, etc.
  • Raise ArgumentError for unknown names passed to the API.

Added

  • Relationship[] to filter relationships by related objects/classes.
  • Role[] accepts Hash-like parameters to filter roles by relationships.
  • Methods for related records:
    • related? to check for related objects,
    • related to fetch them,
    • and the basic relationships.
  • Recursive methods for related records:
    • flat ancestors & descendants with distance,
    • based on recursive association scope.
  • roleless scope for related records without a role.
  • A dedicated association for roleless children.

Fixed

  • Faulty scopes in role-based relationship associations.
  • Naming for namespaced models, e.g., in Rails Engines.

Full Changelog: v0.5.0...v0.6.0

v0.5.0

08 Nov 13:38
c4d7e82

Choose a tag to compare

Refactored from Rails Dynamic Associations.

Some experimental features are missing and can be found in the api branch.

Full Changelog: https://github.com/Alexander-Senko/adjustable_schema/commits/v0.5.0