class Page < ActiveRecord::Base belongs_to :category has_dynamic_attributes :of => :category def virtual_attribute=(something) puts "Setting virtual_attribute to #{something}" end end