Skip to main content
To represent relationships and hierarchical structures in your , you can embed nested objects within your attributes. These nested objects can be arrays, hashes, or a combination of both, provided they can be converted into JSON.
Ruby

Update changes from nested relations with ActiveRecord

To update changes with nested relations using ActiveRecord, use touch and after_touch.
Ruby

Update changes from nested relations with Sequel

With Sequel, you can use the touch plugin to propagate the changes:
Ruby
Last modified on June 12, 2026