class ClusterCollection < ModelCollection
self.item_type = Cluster
end class Organization
field :clusters, ClusterCollection, default: ->{ ClusterCollection.new(common_attrs: { organization: self }) }
end
a factory-native object: item is updated with common_attrs, then added
raw materials for the object: item is constructed (from the merged attrs and common_attrs), then added
# File lib/gorillib/collection/model_collection.rb, line 89 def receive_item(label, *args, &block) attrs = args.extract_options!.merge(common_attrs) super(label, *args, attrs, &block) end
Generated with the Darkfish Rdoc Generator 2.