What happens if <code>@team.save</code> succeeds but <code>@membership.save</code> fails? These should be wrapped in a transaction which ensures that either both records are created or none are. You can create a method on the <code>Team</code> model that saves the object with a membership created:

    class Team
      def save_with_owner(user)
        Team.transaction do
          membership = Membership.new(joinable: self, user: user, role: "owner", state: "active")
          self.save and membership.save
        end
      end
    end