Transparent conversion for ActiveRecord