Added logic to create has_one hash recursively from ruby object and switched from regular merge to deep merge for nested hash.