# Associations

All Futures supports its own variant of [nested attributes](https://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html) via the `embeds_one` / `embeds_many` methods provided by Active Entity. They are mostly compatible with Active Record's `accepts_nested_attributes_for` functionality.

```ruby
class Holiday < AllFutures::Base
  attribute :date, :date
  validates :date, presence: true
end

class HolidaysForm < AllFutures::Base
  embeds_many :holidays
  accepts_nested_attributes_for :holidays, reject_if: :all_blank
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://allfutures.leastbad.com/usage/associations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
