Steve’s answer works but since the instance is of class BaseUser
when save
is called, validations and callbacks defined in User
will not run. You’ll probably want to convert the instance using the becomes method:
user = BaseUser.where(email: "[email protected]").first_or_initialize
user = user.becomes(User) # convert to instance from BaseUser to User
user.type = "User"
user.save!