parent_record = User.find(1)
new_user = User.new(parent_record)
new_user.name = 'new_name'
new_user.save
But this ended in throwing stringify_keys error for User
This can done by specifying
new_user = User.new(parent_record.attributes)
Hope this helps!
No comments:
Post a Comment