Ruby On Rails
Thinkers posting on this topic
No compiled wiki article for this topic yet. Raw entries below are the source material — a wiki article can be generated on demand from /admin/triggers.
All entries on this topic (1)
LazyGenerate: ActiveRecord Module for On-Demand Property Computation and Auto-Save
LazyGenerate is a Ruby module that extends ActiveRecord classes to define lazily generated properties. Accessing an unset property invokes a user-specified generator method, assigns the result, auto-saves the record, and returns the value. Existing values bypass generation, enabling efficient deferr…
