Mapping of ActiveRecord objects to plain old ruby objects and reverse