Method: ActiveRecord::ClassMethods#composed_of
- Defined in:
- lib/reactive_record/active_record/class_methods.rb
#composed_of(name, opts = {}) ⇒ Object
204 205 206 207 208 209 210 |
# File 'lib/reactive_record/active_record/class_methods.rb', line 204 def composed_of(name, opts = {}) Aggregations::AggregationReflection.new(base_class, :composed_of, name, opts) define_method(name) { @backing_record.reactive_get!(name, nil) } define_method("#{name}=") do |val| @backing_record.reactive_set!(name, backing_record.convert(name, val)) end end |