All Futures
  • All Futures
  • Setup
  • Usage
    • Active Record
    • Attributes
    • Associations
    • Aggressions
    • Callbacks
    • Dirty
    • Errors
    • Readonly
    • Validations
    • Versioning
  • API Reference
    • Class Methods
    • Instance Methods
    • Getter Methods
    • Overwritable Methods
  • Examples
    • Faceted Search
Powered by GitBook
On this page

Was this helpful?

  1. Usage

Associations

PreviousAttributesNextAggressions

Last updated 3 years ago

Was this helpful?

All Futures supports its own variant of via the embeds_one / embeds_many methods provided by Active Entity. They are mostly compatible with Active Record's accepts_nested_attributes_for functionality.

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
nested attributes