caring / composition_generator
composition_generator
PublicGenerate ActiveRecord Aggregations and convenience methods for composing them into your models.
9 filesupdated Jun 18, 2026
files5Download
./generatorsJun 18, 2026./libJun 18, 2026init.rbJun 18, 2026MIT-LICENSEJun 18, 2026READMEJun 18, 2026README
CompositionGenerator
Generates a composition model and a convenience method for mixing it into your models.
Example
./script/generate composition address street city state zip_code
class Person < ActiveRecord::Base has_address end
p = Person.new
p.address = Address.new('1234 S. Main St.', 'Anytown', 'CA', 91234)
p.address.street
=> "1234 S. Main St."
p.street
=> "1234 S. Main St."
Copyright (c) 2008 Chris Eppstein, released under the MIT license