Serialize your Rails model based on context