Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Apparently AR doesn't really save the serialized aggregation, although the model seems to be perfectly aware of it.
class Prizes <,:c2)
class Draw < ActiveRecord::Base
composed_of :prizes, :mapping => Prizes.members
draw =
p Draw.column_names.include? "prizes"
# => true
draw.prizes =,2)!
p draw.prizes
# => #<struct Prizes c1=1, c2=2>
p draw[:prizes]
# => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment